2011-11-16 96 views
1

我使用jQuery 1.7和jQuery UI 16年8月1日jQuery的 - 在Internet Explorer中

我做了一个js小提琴显示我在做什么 但它的工作原理罚款removeClass无效的参数与延迟。 它在Internet Explorer中爆炸。 http://jsfiddle.net/MEDtE/4/

我认为这可能与我使用ui-darkness主题有关,但我不明白为什么。

我追踪的问题jQuery的CUR功能

cur: function() { 
    if (this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null)) { 
     return this.elem[this.prop]; 
    } 

    var parsed, 
    r = jQuery.css(this.elem, this.prop); 
    // Empty strings, null, undefined and "auto" are converted to 0, 
    // complex values such as "rotate(1rad)" are returned as is, 
    // simple values such as "10px" are parsed to Float. 
    return isNaN(parsed = parseFloat(r)) ? !r || r === "auto" ? 0 : r : parsed; 
} 

backgroundPositionY显然有topjQuery.css()呼叫的值,则返回该值。

jQuery认为这个值是一个百分比,并发生NaN。

我可以解决这个问题吗?

+0

是你试图删除设置backgroundPositionY类?我不知道为什么你买了它,否则...这听起来像是试图动画,并不能解决如何或什么可能... – Chris

+0

@Chris我从来没有触摸backgroundPositionY和从我可以看到ui-darkness主题也没有。我不知道它为什么在那里。 –

回答

0

什么是第二个参数在removeClass中执行的。 removeClass只需要1个参数。

+0

http://docs.jquery.com/UI/Effects/removeClass – Chris

+0

它只在jQuery UI。所以也许jQuery UI不包括在内? –

1

我有使用setTimeout与浏览器动画混合使用的结果。我会将这一切都保存在jQuery中,并使用jQuery的延迟功能。这应该在所有浏览器中保持不变。

<script> 
$(document).ready(function(){ 
    $('#myp').delay(500).removeClass('ui-state-highlight',1500); 
}); 
</script> 
+0

该错误冒泡出removeClass调用。错误仍然发生。 http://jsfiddle.net/PUbhJ/1/ –

+0

不得不切换到IE浏览器,我可以重现您的错误信息。对不起,我在写解决方案时遇到了问题 – DefyGravity