slideToggle()在IE7中无法正常工作
slideToggle() does not work properly in IE7
我在IE7中遇到jQuery SlideToggle问题。它可以在IE8、IE9、FF、Chrome、Opera中正常工作。当我调试时,我没有得到任何错误。唯一发生的事情是我的event.prventDefault(),但由于某种原因,IE7在我的if语句之后甚至没有尝试做任何事情。这里有一些代码:
/* For handling of open/close the toggler button for categories */
$('ul.categories').on('click', '.toggle button', function(event) {
event.preventDefault();
var $categories = $(this).parent().next('.items'),
$icon = $('.icon', this);
$categories.slideToggle(Interface.animationDuration, function() {
//Somewhere here is stops. It does not even slideToggle.
if ($(this).is(':visible')) {
$icon.removeClass('white-arrow-down').addClass('white-arrow-up');
} else {
$icon.removeClass('white-arrow-up').addClass('white-arrow-down');
}
});
});
<ul class="categories">
<li class="toggle"><button type="button"><span class="icon white-arrow-down"></span></button></li>
<ul class="items">
<li>
<input type="radio" name="category" id="" value=""><label for=""></label>
</li>
<li>
<input type="radio" name="category" id="" value=""><label for=""></label>
</li>
</ul>
</ul>
问题是由于我的嵌套ul引起的。它没有被包裹在li中,这使得我的声明有错误,因为我使用了.pert():
var $categories = $(this).parent().next('.items')
相关文章:
- Javascript:selenium Web驱动程序isDisplayed()不工作
- jQuery UI自动完成突然停止工作
- AngularJS UI路由器不能像ng路由器那样工作
- HTML5音频加载和播放获胜'我不能在iPad上工作
- JavaScript打印功能使日历停止工作
- Javascript.getHours()工作不正常
- 为什么这在IE中的工作方式与在Firefox中不同
- 视频HTML没有'无法在Internet Explorer 11上工作
- 扩展移相器按钮类不工作
- Firebase迁移-简单的Firebase.set没有'不再工作了——旧的还是新的
- 谷歌地图不是以HTML显示,而是在JS Fiddle上工作
- 正在尝试使用if和else添加类,但无法正常工作
- Jquery FadeIn FadeOut 只工作一次
- Foreach无法在Typescript中工作
- 另一个ajax调用中的Jquery ajax调用在for循环中没有按预期工作
- 为什么不是't窗口.恢复正常工作吗?(javascript/jquery)
- JS可以在Chrome中工作,但不能在Firefox中工作
- ajaxToolkit PopupControlExtender不工作.过时的
- HTML标记在脚本标记中工作
- javascript扫雷器floodfill算法不能正常工作