nivo 滑块和下拉菜单在 IE 中不起作用

发布于 2024-10-09 01:38:05 字数 6690 浏览 5 评论 0原文

有谁知道为什么 IE 中的下拉菜单在 nivo 滑块下消失?尝试使用 z-index,没有帮助,我也知道下拉菜单在 flash 内容下消失,但事实并非如此(wmode=transparent)据我所知,nivo 滑块仅使用 jquery,没有 flash 。

这是 html:

<table>
<tr height="50"><td colspan="2" align="right" class="bottom_menu">
<ul id="nav" class="dropdown dropdown-horizontal" >
                                             <li><a href="/index.cfm?fuseaction=home.logout" class="dir" style="border:0 !important;" >Çikis</a></li>   
                                             <li><a href="/index.cfm?fuseaction=objects2.list_basket" class="dir">Sepetim</a></li>
                                             <li><a href="/index.cfm?fuseaction=objects2.me" class="dir">Sirketim</a>
                                                <ul>
                                                 <li><a href="/index.cfm?fuseaction=objects2.list_opportunities">Firsatlar</a></li>
                                                 <li><a href="/index.cfm?fuseaction=objects2.form_add_partner">Sirkete Kullanici Ekle</a></li>
                                                 <li><a href="/index.cfm?fuseaction=objects2.form_upd_my_company">Kullanici Yönetimi</a></li>
                                                 <li><a href="/index.cfm?fuseaction=objects2.list_analyses">Analizler</a></li>
                                                 <li><a href="/index.cfm?fuseaction=objects2.list_extre">Hesap Ekstresi</a></li>
                                                 <li><a href="/index.cfm?fuseaction=objects2.popup_add_online_pos" target="_blank">Sanal Pos</a></li>
                                                </ul>
                                             </li>
                                            </ul>
                                        </td></tr>
                                    </table>

<div id="banner">
    <img src="/documents/templates/projedepo/l_top.gif" style="z-index:1;position:absolute; left:0; top:0;" width="24px" height="24px" border="0" />
    <img src="/documents/templates/projedepo/r_top.gif" style="z-index:1;position:absolute; right:0; top:0;" width="24px" height="24px" border="0" />
    <img src="/documents/templates/projedepo/l_bottom.gif" style="z-index:1;position:absolute; left:0; bottom:0;" width="24px" height="24px" border="0" />
    <img src="/documents/templates/projedepo/r_bottom.gif" style="z-index:1;position:absolute; right:0; bottom:0;" width="24px" height="24px" border="0" />

    <div class="banner_img">
    <link rel="stylesheet" href="/documents/templates/projedepo/banner/nivo-slider.css" type="text/css" media="screen" />
    <link rel="stylesheet" href="/documents/templates/projedepo/banner/style.css" type="text/css" media="screen" />

    <div id="slider" class="nivoSlider">
        <img title="#1" src="/documents/templates/projedepo/banner/canon.jpg" alt="" />
        <img title="#2" src="/documents/templates/projedepo/banner/indigovision.jpg" alt="" />
    </div>
    <div id="1" class="nivo-html-caption">
        <a href="/index.cfm?fuseaction=objects2.detail_product&product_id=612&stock_id=612"><img src="/documents/templates/projedepo/banner/daha_fazlasi.jpg" border="0" /></a>
    </div>
    <div id="2" class="nivo-html-caption">
        <a href="/index.cfm?fuseaction=objects2.detail_product&product_id=630&stock_id=630"><img src="/documents/templates/projedepo/banner/daha_fazlasi.jpg" border="0" /></a>
    </div>

    <script type="text/javascript" src="/JS/jquery.nivo.slider.pack.js"></script>
    <script type="text/javascript">
    $(window).load(function() {
        $('#slider').nivoSlider({
        effect:'random', //Specify sets like: 'fold,fade,sliceDown'
        slices:15,
        animSpeed:1000, //Slide transition speed
        pauseTime:10000,
        startSlide:0, //Set starting Slide (0 index)
        directionNav:true, //Next & Prev
        directionNavHide:true, //Only show on hover
        controlNav:true, //1,2,3...
        controlNavThumbs:false, //Use thumbnails for Control Nav
        controlNavThumbsFromRel:false, //Use image rel for thumbs
        controlNavThumbsSearch: '.jpg', //Replace this with...
        controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
        keyboardNav:true, //Use left & right arrows
        pauseOnHover:true, //Stop animation while hovering
        manualAdvance:false, //Force manual transitions
        captionOpacity:1.0, //Universal caption opacity
        beforeChange: function(){},
        afterChange: function(){},
        slideshowEnd: function(){}, //Triggers after all slides have been shown
        lastSlide: function(){}, //Triggers when last slide is shown
        afterLoad: function(){} //Triggers when slider has loaded
        });
    });
    </script>
    </div>
</div>

这是下拉菜单的 css:

http://www.micae .com/documents/templates/projedepo/default.css

http ://www.micae.com/documents/templates/projedepo/default.advanced.css

http://www.micae.com/documents/templates/projedepo/dropdown.css

和 nivo 滑块:

http://www.micae.com/documents/templates/projedepo/banner/style.css

http://www.micae.com/documents/templates/projedepo/banner/nivo-slider.css< /a>

和横幅 div:

#banner { position:relative; width:980px; height:435px; background:#fff; margin-bottom:20px; margin-top:-1px; color:#000; z-index:60; }
.banner_img { padding:8px;position:absolute;z-index:2; }

默认情况下使用 javascript、jquery 和 nivo slider

http://www.micae.com/JS/jquery.nivo.slider.pack.js

我忘了提醒,没有定义文档类型,这实际上是问题所在,有什么想法如何解决它?我的意思是没有文档类型定义。因为当我定义文档类型时,设计完全崩溃了......

Does anyone has any idea why drop down menu in IE disappear under nivo slider? tried to play with z-index, didn't help, i also know that drop down menus dissappear under flash content, but this is not the case(wmode=transparent) as far as i know the nivo slider uses just jquery, no flash.

here is the html:

<table>
<tr height="50"><td colspan="2" align="right" class="bottom_menu">
<ul id="nav" class="dropdown dropdown-horizontal" >
                                             <li><a href="/index.cfm?fuseaction=home.logout" class="dir" style="border:0 !important;" >Çikis</a></li>   
                                             <li><a href="/index.cfm?fuseaction=objects2.list_basket" class="dir">Sepetim</a></li>
                                             <li><a href="/index.cfm?fuseaction=objects2.me" class="dir">Sirketim</a>
                                                <ul>
                                                 <li><a href="/index.cfm?fuseaction=objects2.list_opportunities">Firsatlar</a></li>
                                                 <li><a href="/index.cfm?fuseaction=objects2.form_add_partner">Sirkete Kullanici Ekle</a></li>
                                                 <li><a href="/index.cfm?fuseaction=objects2.form_upd_my_company">Kullanici Yönetimi</a></li>
                                                 <li><a href="/index.cfm?fuseaction=objects2.list_analyses">Analizler</a></li>
                                                 <li><a href="/index.cfm?fuseaction=objects2.list_extre">Hesap Ekstresi</a></li>
                                                 <li><a href="/index.cfm?fuseaction=objects2.popup_add_online_pos" target="_blank">Sanal Pos</a></li>
                                                </ul>
                                             </li>
                                            </ul>
                                        </td></tr>
                                    </table>

<div id="banner">
    <img src="/documents/templates/projedepo/l_top.gif" style="z-index:1;position:absolute; left:0; top:0;" width="24px" height="24px" border="0" />
    <img src="/documents/templates/projedepo/r_top.gif" style="z-index:1;position:absolute; right:0; top:0;" width="24px" height="24px" border="0" />
    <img src="/documents/templates/projedepo/l_bottom.gif" style="z-index:1;position:absolute; left:0; bottom:0;" width="24px" height="24px" border="0" />
    <img src="/documents/templates/projedepo/r_bottom.gif" style="z-index:1;position:absolute; right:0; bottom:0;" width="24px" height="24px" border="0" />

    <div class="banner_img">
    <link rel="stylesheet" href="/documents/templates/projedepo/banner/nivo-slider.css" type="text/css" media="screen" />
    <link rel="stylesheet" href="/documents/templates/projedepo/banner/style.css" type="text/css" media="screen" />

    <div id="slider" class="nivoSlider">
        <img title="#1" src="/documents/templates/projedepo/banner/canon.jpg" alt="" />
        <img title="#2" src="/documents/templates/projedepo/banner/indigovision.jpg" alt="" />
    </div>
    <div id="1" class="nivo-html-caption">
        <a href="/index.cfm?fuseaction=objects2.detail_product&product_id=612&stock_id=612"><img src="/documents/templates/projedepo/banner/daha_fazlasi.jpg" border="0" /></a>
    </div>
    <div id="2" class="nivo-html-caption">
        <a href="/index.cfm?fuseaction=objects2.detail_product&product_id=630&stock_id=630"><img src="/documents/templates/projedepo/banner/daha_fazlasi.jpg" border="0" /></a>
    </div>

    <script type="text/javascript" src="/JS/jquery.nivo.slider.pack.js"></script>
    <script type="text/javascript">
    $(window).load(function() {
        $('#slider').nivoSlider({
        effect:'random', //Specify sets like: 'fold,fade,sliceDown'
        slices:15,
        animSpeed:1000, //Slide transition speed
        pauseTime:10000,
        startSlide:0, //Set starting Slide (0 index)
        directionNav:true, //Next & Prev
        directionNavHide:true, //Only show on hover
        controlNav:true, //1,2,3...
        controlNavThumbs:false, //Use thumbnails for Control Nav
        controlNavThumbsFromRel:false, //Use image rel for thumbs
        controlNavThumbsSearch: '.jpg', //Replace this with...
        controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
        keyboardNav:true, //Use left & right arrows
        pauseOnHover:true, //Stop animation while hovering
        manualAdvance:false, //Force manual transitions
        captionOpacity:1.0, //Universal caption opacity
        beforeChange: function(){},
        afterChange: function(){},
        slideshowEnd: function(){}, //Triggers after all slides have been shown
        lastSlide: function(){}, //Triggers when last slide is shown
        afterLoad: function(){} //Triggers when slider has loaded
        });
    });
    </script>
    </div>
</div>

Here is css for dropdown menu:

http://www.micae.com/documents/templates/projedepo/default.css

http://www.micae.com/documents/templates/projedepo/default.advanced.css

http://www.micae.com/documents/templates/projedepo/dropdown.css

and for nivo slider:

http://www.micae.com/documents/templates/projedepo/banner/style.css

http://www.micae.com/documents/templates/projedepo/banner/nivo-slider.css

and for banner divs:

#banner { position:relative; width:980px; height:435px; background:#fff; margin-bottom:20px; margin-top:-1px; color:#000; z-index:60; }
.banner_img { padding:8px;position:absolute;z-index:2; }

and the javascript by default, jquery and nivo slider

http://www.micae.com/JS/jquery.nivo.slider.pack.js

I forgot to mantion, that there is no doctype defined, that's was actually the problem, any ideas how to solve it? i mean without doctype definition. coz when i define the doctype, the design totally crashes...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

罗罗贝儿 2024-10-16 01:38:05

IE 可以用 z-index 做一些疯狂的事情,特别是当元素没有定位时。确保问题元素及其所有祖先元素在 CSS 中显式相对或绝对定位。似乎只要链中某个地方出现中断,就会创建一个全新的堆叠顺序。

就我个人而言,我的默认CSS中总是有这样的东西:

div, ul, li {position:relative;}

它似乎解决了很多问题。

IE can do some craziness with z-index especially when elements are not positioned. Make sure the trouble elements, and all their ancestors are positioned relative or absolute explicitly in your css. It seems like a whole new stacking order is created as soon as there is a break in the chain somewhere.

personally, I always have something like this in my default css:

div, ul, li {position:relative;}

It seems to solve a lot of problems.

冷月断魂刀 2024-10-16 01:38:05

我也有同样的问题。只需确保将下拉 css 中的所有元素设置为具有非常高的 z 索引和明确的定位(例如,确保为每个元素进行状态 - 相对-绝对等)。对我来说,问题只发生在 IE 中,而不是 Firefox 或 chrome,但更改这些值(z-index > 300+)解决了我的问题。我希望这对您有帮助,祝您好运!

I had the same problem. Just make sure that you set all the elements in your dropdown css to have very high z-indexes and explicit positioning ( as in, make sure you state for each one - relative-absolute-etc). For me, the problem only happened in IE, not firefox or chrome, but changing these values (z-index >300+) fixed the problem for me. I hope this helps you, best of luck!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文