Spry Menu Bar works great in Firefox but Messed up in IE
by Steve Foglia
on
Jun 29, 2009 at 7:22:08 pm
http://www.businesstobusinessnetwork.com
I'm using Dreamweavers spry drop down Horizontal menu bar and it works great with firefox. However in IE the sub menu bar displays horizontal rather than vertical, making the lower level menu bar fly off the page. Strange.
I went to the adobe site and downloaded the latest update for spry which solved my earlier problems where all the lower menu bars were flying off the page. The menu bars should display as seen using firefox or with the main menu bars running horizontal across the page with the lower level menu bars appearing directly below and slightly to the right.
I would appreciate any suggestions anyone might have for solving this problem
Re: Spry Menu Bar works great in Firefox but Messed up in IE by Richard Williams on Jun 29, 2009 at 8:30:19 pm
if you use auto settings for widths then you are leaving the browsers to interpret the look anyway they feel like it... try putting in some values for the width settings to suit your site
Re: Spry Menu Bar works great in Firefox but Messed up in IE by Matthew Redding on Jul 1, 2009 at 5:16:31 pm
Hi Richard,
I have seen some of your threads related to this issue and am wandering if you could look at my code please.
My horizontal spry menu uses rollover PNG's and I have it working ok except the drop downs have what looks like a drop down form box beneath my submenu PNG.
It works fine in Firefox but this only happens in IE7 (IE6 is all messed up too but trying to sort out 7 issue first or maybe something you suggest will sort it altogether.
/* The outermost container of the Menu Bar, an auto width box with no margin or padding */
ul.MenuBarHorizontal
{
margin: 0;
list-style-type: none;
cursor: default;
width: auto;
font-size: 50%;
padding-top: 0em;
padding-right: 0;
padding-bottom: 0em;
padding-left: 0;
}
/* Set the active Menu Bar with this class, currently setting z-index to accomodate IE rendering bug: http://therealcrisp.xs4all.nl/meuk/IE-zindexbug.html */
ul.MenuBarActive
{
z-index: 1000;
}
/* Menu item containers, position children relative to this container and are a fixed width */
ul.MenuBarHorizontal li
{
list-style-type: none;
position: relative;
text-align: left;
cursor: pointer;
width: auto;
float: left;
padding-top: 0em;
padding-right: 0em;
padding-bottom: 0em;
padding-left: 0em;
margin: 0;
font-size: 50%;
}
/* Submenus should appear below their parent (top: 0) with a higher z-index, but they are initially off the left side of the screen (-1000em) */
ul.MenuBarHorizontal ul
{
margin: 0;
list-style-type: none;
z-index: 1020;
cursor: default;
width: auto;
position: absolute;
left: -1000em;
padding-top: 0.3em;
padding-right: 0;
padding-bottom: 0;
padding-left: 0.3em;
}
/* Submenu that is showing with class designation MenuBarSubmenuVisible, we set left to auto so it comes onto the screen below its parent menu item */
ul.MenuBarHorizontal ul.MenuBarSubmenuVisible
{
left: auto;
}
/* Menu item containers are same fixed width as parent */
ul.MenuBarHorizontal ul li
{
width: auto;
}
/* Submenus should appear slightly overlapping to the right (95%) and up (-5%) */
ul.MenuBarHorizontal ul ul
{
position: absolute;
margin-top: 0%;
margin-right: 0;
margin-bottom: 0;
margin-left: 0%;
}
/* Submenu that is showing with class designation MenuBarSubmenuVisible, we set left to 0 so it comes onto the screen */
ul.MenuBarHorizontal ul.MenuBarSubmenuVisible ul.MenuBarSubmenuVisible
{
left: auto;
top: 0;
}
/* Submenu containers have borders on all sides */
ul.MenuBarHorizontal ul
{
border-top-style: none;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
}
/* Menu items are a light gray block with padding and no text decoration */
ul.MenuBarHorizontal a
{
display: block;
cursor: pointer;
text-align: left;
}
/* Menu items that have mouse over or focus have a blue background and white text */
ul.MenuBarHorizontal a:hover, ul.MenuBarHorizontal a:focus
{
}
/* Menu items that are open with submenus are set to MenuBarItemHover with a blue background and white text */
ul.MenuBarHorizontal a.MenuBarItemHover, ul.MenuBarHorizontal a.MenuBarItemSubmenuHover, ul.MenuBarHorizontal a.MenuBarSubmenuVisible
{
/* Menu items that have a submenu have the class designation MenuBarItemSubmenu and are set to use a background image positioned on the far left (95%) and centered vertically (50%) */
ul.MenuBarHorizontal a.MenuBarItemSubmenu
{
background-repeat: no-repeat;
background-position: 95% 50%;
}
/* Menu items that have a submenu have the class designation MenuBarItemSubmenu and are set to use a background image positioned on the far left (95%) and centered vertically (50%) */
ul.MenuBarHorizontal ul a.MenuBarItemSubmenu
{
background-repeat: no-repeat;
background-position: 95% 50%;
}
/* Menu items that are open with submenus have the class designation MenuBarItemSubmenuHover and are set to use a "hover" background image positioned on the far left (95%) and centered vertically (50%) */
ul.MenuBarHorizontal a.MenuBarItemSubmenuHover
{
background-repeat: no-repeat;
background-position: 95% 50%;
}
/* Menu items that are open with submenus have the class designation MenuBarItemSubmenuHover and are set to use a "hover" background image positioned on the far left (95%) and centered vertically (50%) */
ul.MenuBarHorizontal ul a.MenuBarItemSubmenuHover
{
background-repeat: no-repeat;
background-position: 95% 50%;
}
/* HACK FOR IE: to make sure the sub menus show above form controls, we underlay each submenu with an iframe */
ul.MenuBarHorizontal iframe
{
position: absolute;
z-index: 1010;
}
/* HACK FOR IE: to stabilize appearance of menu items; the slash in float is to keep IE 5.0 from parsing */
@media screen, projection
{
ul.MenuBarHorizontal li.MenuBarItemIE
{
display: inline;
float: left;
}
}
Re: Spry Menu Bar works great in Firefox but Messed up in IE by Steve Foglia on Jul 2, 2009 at 5:21:17 pm
Thanks, replacing auto value with an actual px width seems to work.
However seeing that each menu bar is a different width I can't seem to find the appropriate number to input that would balance the menu bar horizontally so that the title of each menu bar isn't cut off.
I managed to find a fix to my problem. I didn't explain it well in my message.
I used PNG files for my menu links and took away the border, colour, hover colour, etc. settings so everything was see through but when I put my mouse over the drop downs a box appeared with 'False' written inside. I couldnt see the txt at first as the box was very small but I did another test with bigger buttons and then I noticed this.
You were helping another user who in turn found a fix which was to change the 'visibility' to 'hidden' on the ul.MenuBarHorizontal iframe rule. This seemed to fix my problem too.
I saw what you said to her about her SpryMenuBar.css and SpryMenuBarHorizontal.css being corrupt and to replce them. I had already tried this by using your newer SpryMenuBar.css code as I was using an older version but this didn't work for me.
Anyway my problem is fixed, it probably isn't the correct way to do it but it's working so thank you for your reply.
Re: Spry Menu Bar works great in Firefox but Messed up in IE by Matthew Redding on Jul 16, 2009 at 12:00:19 pm
Hi Richard,
Sorry I have another question. My website http://www.primepltd.com has some issues in IE6. I managed to fix the issue of IE6 not showing PNG transparency by using a JS include file on my pages but there is still the issue of the div container tiling downwards.
The div container in IE6 tiles down a little bit, the height of it does not stay as specified. I have 2 tables inside my div container for the spry menu and other PNG files (heading, copy, right hand side text).
Maybe you can take a look for me and see what I am doing incorrectly. The code for this is in one of my earlier posts.
Re: Spry Menu Bar works great in Firefox but Messed up in IE by Richard Williams on Jul 16, 2009 at 7:55:26 pm
The problem here is the margin setting in your css.
You have a top-margin set at 50px.
The way this works, is if you have a margin of 50px, and a height of 459px, then the TOTAL height is read as 509px... since your image is 459px in height, it is repeating for a further 50px. (hopefully this makes sense...?)
Not having the availability to test in IE6 locally, i can not give you a straight answer in how to repair this. Possibly adding a background-repeat: no repeat to the .oneColElsCtr #container might rectify the problem, but if not, the create a new div for the background image, with a hieght of 459, and the image background, then reduce your .oneColElsCtr #container div height by 50px's...
Something like that aught to do the job for you, but let me know if not and i will do some further investigaiton :o)
Re: Spry Menu Bar works great in Firefox but Messed up in IE by Matthew Redding on Jul 16, 2009 at 10:10:43 pm
Hi,
Thank you for your reply.
The no repeat on the container did stop it repeating but then there was white space at the bottom with a border around it all. So then I added the div background and put the Nav bar div inside this along with the table containing the heading, copy & right side txt but with the background image in the div background now it just did the same thing.
I deleted an extra row at the bottom of the table and this seemed to bring everything up without showing the repeating image. But now if I position the bottom edge of the table just inside the div background when I test the site in any browser (ie6/7, FF, etc...) the table has jumped up out of position.