IE8幻灯片切换问题

时间:2010-04-22 21:44:21

标签: jquery

我在IE8中遇到一些jQuery的slideToggle功能有问题因为某些原因它的开启后DIV立即关闭

使用

继承代码
$("h3 a").click(function(){
    id = $(this).attr("href");      
    $(id).slideToggle("slow");
});

和HTML

<h3><a href="#promo-materials">Graphic and Pormotional Materials</a></h3>
    <div id="promo-materials" class="center gallery">
        <a href="images/portfolio/bistro.png" rel="facebox">
            <img src="images/portfolio/thumbs/bistro.png" alt="" />
        </a>
        <a href="images/portfolio/direct-savings.png" rel="facebox">
            <img src="images/portfolio/thumbs/direct-savings.png" alt="" />
        </a>
     </div>

以下是其在所有其他浏览器中工作的功能页面的链接,包括IE7

我忘记发帖了:

http://bestprintideas.com

我现在有触发兼容模式,因为我今天必须开始工作。

3 个答案:

答案 0 :(得分:3)

从图库

之前的h3中删除此样式
display: inline-block;

似乎解决了IE8中的问题。

答案 1 :(得分:0)

你可以试试这个:

$("h3 a").click(function(){
    id = $(this).attr("href");
    $('#' + id).slideToggle("slow");
});

答案 2 :(得分:0)

我打赌尼克关于被解雇两次的评论是答案。我复制了上面的代码,它在IE8中对我很有用。