Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Apr 2010
    Posts
    220
    Thanks
    116
    Thanked 1 Time in 1 Post

    Javascript menu appearing behind content (screenshot inside)

    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:


    Here is how it should look:


    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!

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    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?verbos...idCategory%3D2
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • Users who have thanked Excavator for this post:

    BlackReef (05-11-2010)

  • #3
    Regular Coder
    Join Date
    Apr 2010
    Posts
    220
    Thanks
    116
    Thanked 1 Time in 1 Post
    Quote Originally Posted by Excavator View Post
    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?verbos...idCategory%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


    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

  • #4
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    On the page that works the way it should, http://gem-tech.com.mytempweb.com/st...categories.asp , the h1 is just a heading alone.
    On a page that doesn't work right, http://gem-tech.com.mytempweb.com/st...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.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • Users who have thanked Excavator for this post:

    BlackReef (05-11-2010)

  • #5
    New Coder
    Join Date
    May 2009
    Posts
    74
    Thanks
    0
    Thanked 7 Times in 7 Posts
    Try removing position: relative; form h1

    Regards.

  • Users who have thanked frankle for this post:

    BlackReef (05-11-2010)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •