开发者

jQuery slideToggle not working on IE8 [duplicate]

This question already has answers here: Closed 11 years ago.

Possible Duplicate:

Jquery slideToggle problem in IE8 only using lists

I have a code that slideToggles the contents of list items. It works fine in FF but in IE8 when clicking the item, instead of slide show the content, it always shows the content and slides up to hide it. Here is the code of the l开发者_如何学编程ist:

<ul class="accordion">
    <li>
        <h4 class="head">Title 1</h4>
        <p>Content 1.</p>
    </li>
    <li>
        <h4 class="head">Title 2</h4>
        <p>Content 2.</p>
    </li>
</ul>

This is the JS/jQuery code:

$(document).ready(function(){
    $('.accordion .head').click(function() {
        $(this).next().slideToggle(250);
        return false;
    }).next().hide();
});

And here is the online page: http://grupoautolider.com.ar/galeria/cabriolet

This is strange because this code is featured in jQuery UI's doc page. It must be noted that this doesn't happen in IE7. I would be very grateful for your answers. Thanks in advance.


I guess you are talking about the problem as mentioned here : slideToggle causes margin to disappear in IE8

just giving overflow:hidden to the divs where margin is disappearing would solve it. please check..

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜