2011-11-16 97 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