2012-04-20 81 views
2

我正在修改IE8的bootstrap carousel支持。这工作在铬和FF,但不是IE 8,它会改变没有淡入。有谁知道为什么?Jquery addClass fadeIn fadeOut不能在IE8中工作

<style> 
    .carousel .activerow {display: none;} 
    .carousel .row { left: 0; opacity: 1; } 
    </style> 

    /*I have many rows of data in the dom 
    They are not visible until'active' class 
    is added. 

    This code is binded to a link 
    */ 
    var activeset = $active; //contains the contents of current row 
    var nextset = $next; //contains contents of the next 

    $active.fadeOut('slow', function() {    
     activeset.removeClass('activerow'); 
     nextset.addClass('active'); 
     nextset.fadeIn('slow');   

    }); 
+1

什么东西显示在您的控制台? – Sampson 2012-04-20 17:06:20

+0

在控制台 – River 2012-04-20 17:16:10

回答

1

我想你有一个类型o。

$active.fadeOut(.... 

可能需要

$(active).fadeOut(.... 

编辑:我张贴在此之前没有想到的。

既然你正在缓存元素,你确定你的选择器正在返回一个匹配?

+0

没有错误尝试它,但没有任何差异。这只会创建jquery dom对象吗? – River 2012-04-20 17:21:02

+0

那么,如果你引用$ active,你必须在var active = $(选择器)的某处缓存它。你确定选择器正在返回元素吗? – Rick 2012-04-20 17:22:33

+0

我认为IE8不支持CSS不透明度。这就是它不起作用的原因 – River 2012-04-20 23:52:57