views:

591

answers:

3

Hi all,

For the life of me I cannot get my Superfish menu to stop hiding behind my jQuery UI tabs in IE 7. I have read the documentation out there, have tried changing z-index values and tried the bgIframe plugin, although I am not sure if I am implementing it correctly (left out in my example below, using Supersubs).

Here is the Javascript I am using for Superfish - using the Supersubs plugin:

 $(document).ready(function() { 
                        $("ul.sf-menu").supersubs({ 
                        minWidth:    12,   // minimum width of sub-menus in em units 
                        maxWidth:    27,   // maximum width of sub-menus in em units 
                        extraWidth:  1     // extra width can ensure lines don't sometimes turn over 
                                   // due to slight rounding differences and font-family 
                    }).superfish({ 
                        delay:       1000,                            // one second delay on mouseout 
                        animation:   {opacity:'show',height:'show'},  // fade-in and slide-down animation 
                        speed:       'medium'                          // faster animation speed 
                    }); 
                    });

And here is the structure of my page:

<div id="page-container">
        <div id="header"></div>
        <div id="nav-admin">
            <!-- This is where Superfish goes -->
        </div>
        <div id="header-shadow"></div>
        <div id="content">
            <div id="admin-main">
                <div id="tabs">
                    <ul>
                        <li><a href="#tabs-1">Tab 1</a></li>
                        <li><a href="#tabs-2">Tab 2</a></li>
                    </ul>
                    <div id="tabs-1">
                        <!-- Content for Tab 1 -->
                    </div>
                    <div id="tabs-2">
                        <!-- Content for Tab 2 -->
                    </div>
                </div>
            </div>
        </div>
        <div id="footer-shadow"></div>
        <div id="footer">
            <div id="alt-nav">
                <?php include $_SERVER['DOCUMENT_ROOT'] . '/includes/altnav.inc.php'; //CHANGE WHEN UPLOADED TO MATCH DOCUMENT ROOT ?>
            </div>
        </div>
    </div>
+3  A: 

Have you tried setting position:relative on the elements you are setting the z-index on? That usually does the trick.

franko75
That seems to have done the trick! I wonder why the docs I found did not mention this.. or why the bgIframe plugin didn't seem to make a difference? Thanks so much :)
NightMICU
Thanks for this answer, helped me out!
Liam Spencer
A: 

I'm having the same issue. I believe it has something to do with the container it's positioned in. Say that's located in a header with the height 100px, de fly-out will slide behind the limits of that container. Z-indexes aren't working out so far (with position: relative on all involved elements ofcourse).

My problem was solved by setting a z-index of 3 and position: relative; on #nav, z-index of 1 and position:relative; on #content. It would be nice if jQuery could do something about this, only issue I had was with Tabs (so far).
NightMICU
A: 

NightMICU, that was beautiful.

Mary