简体   繁体   English

jQuery手风琴不能在IE 9中工作?

[英]Jquery accordions not working in IE 9?

Why doesn't this work in IE 9? 为什么在IE 9中不起作用? jsfiddle it refuses to open on click, it works fine on all browsers except IE9 > I just can't seem to figure out why! jsfiddle它拒绝单击打开,在IE9以外的所有浏览器上都可以正常工作>我只是似乎不知道为什么! any help is much appriciated. 任何帮助都非常有用。

/* Accordions */
$(".acc_item").click(function(){

    $(this).siblings().children(".accordion_content").not($(this).find(".accordion_content")).slideUp(600,'easeInOutExpo');
    $(this).siblings().children(".accordion").not($(this).find(".accordion")).removeClass("active_acc");

    $(this).find(".accordion").next(".accordion_content").slideToggle(600,'easeInOutExpo');

    if($(this).find(".accordion").hasClass('active_acc')){
        $(this).find(".accordion").removeClass("active_acc");
    }else{
        $(this).find(".accordion").addClass("active_acc");
    }
});

// Open First item if accordion whenever set so
setTimeout(function(){$(".acc_is_open").delay(1500).click();},600); 
/* Accordions::END */

Try this: Demo 试试这个: 演示

$(".acc_item").click(function () {
    $(this).siblings().children(".accordion_content").slideUp(600, 'easeInOutExpo');
    $(this).siblings().children(".accordion").removeClass("active_acc");

    $(this).find(".accordion_content").slideToggle(600, 'easeInOutExpo');

    if ($(this).find(".accordion").hasClass('active_acc')) {
        $(this).find(".accordion").removeClass("active_acc");
    } else {
        $(this).find(".accordion").addClass("active_acc");
    }
});

setTimeout(function () {
    $(".acc_is_open").delay(1500).click();
}, 600);

Try: 尝试:

$(this).find(".accordion_content").slideToggle(600,'easeInOutExpo');

Also notice that I have included the easing plugin. 还要注意,我已经包含了easing插件。

Fiddle here 在这里摆弄

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

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