z-index issues with jQuery Tabs, Superfish Menu

拈花ヽ惹草 提交于 2019-12-13 16:05:30

问题


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>

回答1:


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



来源:https://stackoverflow.com/questions/2784944/z-index-issues-with-jquery-tabs-superfish-menu

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!