简体   繁体   English

SlideDown 事件在 IE 浏览器(版本 7)中不起作用

[英]SlideDown event not worked in IE Browser(Version 7)

I made a site but there something wrong in IE7 I have a navigation and when I click on a li-element all the li's slideup and the matching div slidesdown.我创建了一个站点,但是 IE7 中出现了一些问题,我有一个导航,当我单击 li 元素时,所有 li 的向上滑动和匹配的 div 向下滑动。

This works in all the browsers except IE7这适用于除 IE7 之外的所有浏览器

Does anyone know what I need to do to fix this?有谁知道我需要做什么来解决这个问题? cause the min-width: 0 doesn't work and I have to use position: relative导致 min-width: 0 不起作用,我必须使用 position: relative

The slideup works but the slidedown doesn't.向上滑动有效,但向下滑动无效。

This is what I have...这就是我所拥有的...

 var $j = jQuery.noConflict(); $j(function() { $j('ul#menus li a').click( function() { $j('#menu-container .post').slideUp(); $j('#menu-container #post-' + $j(this).attr('class')).slideDown(); }); });
 /* Menu */ #menu-container { display: table; margin: 0px auto; padding-top: 50px; width: 500px; text-align: center; } #menu-container .post { display: none; margin: 25px auto 50px; width: 575px; min-width: 0; } #menu-container .first_item { display: block; } #menu-container h2 { margin-bottom: 20px; }
 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <ul id="menus"> <li class="post-1 post type-post hentry category-menus" id="post-1"> <h2><a href="#" rel="bookmark" title="Permanent Link to menu01" class="1">menu01</a></h2> </li> <li class="post-11 post type-post hentry category-menus" id="post-11"> <h2><a href="#" rel="bookmark" title="Permanent Link to menu02" class="11">menu02</a></h2> </li> <li class="post-59 post type-post hentry category-menus" id="post-59"> <h2><a href="#" rel="bookmark" title="Permanent Link to menu03" class="59">menu03</a></h2> </li> </ul> <div id="menu-container"> <div class="post-1 post type-post hentry category-menus first_item" id="post-1"> Content </div> <div class="post-11 post type-post hentry category-menus" id="post-11"> Content </div> <div class="post-59 post type-post hentry category-menus" id="post-59"> Content </div> </div> <!-- end #menu-container-->

Classes can not be numbers.类不能是数字。 Try changing your classes to words and see if that works.尝试将您的类更改为单词,看看是否有效。

class="title_11"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM