...

View Full Version : Javascript menu appearing behind content (screenshot inside)



BlackReef
05-09-2010, 06:30 AM
Hello,

I initially posted this in another sub-forum here, but I think this may be more of a CSS issue.

I followed a Mega Drop Down menu tutorial and everything is working great, except for some reason on certain pages - when the menu drops down, some table elements behind the menu actually appear in front of it? I'm not quite sure what or why this is happening.

Here is the URL for reference.
http://gem-tech.com.mytempweb.com/store/pc/home.asp

Here is an example of what I am talking about:
http://www.blackreefdesigns.com/misc/example.png

Here is how it should look:
http://www.blackreefdesigns.com/misc/example1.png

And here is the CSS:

body {
margin: 0; padding: 0;
font: normal 10px Verdana, Arial, Helvetica, sans-serif;
}
*{outline: none;}
img {border: 0;}
.container {
width: 447px;
padding: 0;
margin: 0 auto;
}
ul#topnav {
margin: 0; padding: 0;
float:left;
width: 100%;
list-style: none;
font-size: 1.1em;
}
ul#topnav li {
float: left;
margin: 0; padding: 0;
position: relative;
}
ul#topnav li a {
float: left;
text-indent: -9999px;
height: 44px;
}
ul#topnav li:hover a, ul#topnav li a:hover { background-position: left bottom; }
ul#topnav a.products {
background: url(images/nav_home.png) no-repeat;
width: 170px;
}
ul#topnav a.support {
background: url(images/nav_products.png) no-repeat;
width: 159px;
}
ul#topnav a.about {
background: url(images/nav_sale.png) no-repeat;
width: 59px;
}
ul#topnav a.blog {
background: url(images/nav_community.png) no-repeat;
width: 59px;
}

ul#topnav li .sub {
position: absolute;
top: 44px; left: 0;
background: #4e4336 url(images/sub_bg.png) repeat-x;
padding: 20px 20px 20px;
float: left;
/*--Bottom right rounded corner--*/
-moz-border-radius-bottomright: 5px;
-khtml-border-radius-bottomright: 5px;
-webkit-border-bottom-right-radius: 5px;
/*--Bottom left rounded corner--*/
-moz-border-radius-bottomleft: 5px;
-khtml-border-radius-bottomleft: 5px;
-webkit-border-bottom-left-radius: 5px;
display: none;
}
ul#topnav li .row {clear: both; float: left; width: 100%; margin-bottom: 10px;}
ul#topnav li .sub ul{
list-style: none;
margin: 0; padding: 0;
width: 150px;
float: left;
}
ul#topnav .sub ul li {
width: 100%;
color: #fff;
}
ul#topnav .sub ul li h2 {
padding: 0; margin: 0;
font-size: 1.3em;
font-weight: normal;
}
ul#topnav .sub ul li h2 a {
padding: 5px 0;
background-image: none;
color: #e8e000;
}
ul#topnav .sub ul li a {
float: none;
text-indent: 0; /*--Reset text indent--*/
height: auto;
background: url(images/navlist_arrow.png) no-repeat 5px 12px;
padding: 7px 5px 7px 15px;
display: block;
text-decoration: none;
color: #fff;
}
ul#topnav .sub ul li a:hover {color: #ddd; background-position: 5px 12px ;}

Any help would be appreciated, thanks!

Excavator
05-09-2010, 04:03 PM
Hello BlackReef,
It looks like your menu is working as intended in FF3.x, IE8 and IE7. I don't have IE6 to test in...

You do have a few things found by the validator that could be fixed - http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fgem-tech.com.mytempweb.com%2Fstore%2Fpc%2FviewCategories.asp%3FpageStyle%3Dh%26idCategory%3D2

BlackReef
05-09-2010, 11:02 PM
Hello BlackReef,
It looks like your menu is working as intended in FF3.x, IE8 and IE7. I don't have IE6 to test in...

You do have a few things found by the validator that could be fixed - http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fgem-tech.com.mytempweb.com%2Fstore%2Fpc%2FviewCategories.asp%3FpageStyle%3Dh%26idCategory%3D2

Hi Excavator,

Thank you for your reply!

Ok, well, what I am doing to replicate the issue - in Firefox 3.6.3, is from the home page:

http://gem-tech.com.mytempweb.com

I will click on 'Products & Services' Now when you get to the page with the 6 category thumbnails, the menu still seems to work fine. However once you click on a category, I notice the menu on the next page starts acting strange.

So, Products & Services > Centerfire Rifle Suppressors > then on this page the menu starts acting weird.

http://gem-tech.com.mytempweb.com/store/pc/viewCategories.asp?pageStyle=h&idCategory=5 (http://gem-tech.com.mytempweb.com/store/pc/viewCategories.asp?pageStyle=h&idCategory=5)

I don't quite understand, as the <h1> table row that is appearing through should be the same on any page you go to, strange

Excavator
05-10-2010, 12:11 AM
On the page that works the way it should, http://gem-tech.com.mytempweb.com/store/pc/viewcategories.asp , the h1 is just a heading alone.
On a page that doesn't work right, http://gem-tech.com.mytempweb.com/store/pc/viewCategories.asp?pageStyle=h&idCategory=4 , that same h1 has a lot of inline styles added to it as well as the added div inside the h1 which is not valid.

I wonder if you might try enclosing that "find a dealer" button in the h1 and not even using that extra div... I would have to investigate to see if that is a valid approach.
You could try wrapping the div around the h1 and the dealer button which would be valid, then that might or might not need a z-index set on it ... you'd have to experiment.

Either way, the validator shows a problem at line 706 on the broken page so I would think validating would be the first step.

frankle
05-10-2010, 06:07 AM
Try removing position: relative; form h1

Regards.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum