2015-08-22 37 views
0

請檢查http://jsfiddle.net/integerz/k19x8L1b/2/其中有1.7.xjQuery的動畫是行爲異常,當我升級到1.11

$(function() { 
    $("#clickme").toggle(function() { 
     $(this).parent().animate({right:'0px'}); 
    }, function() { 
     $(this).parent().animate({right:'-280px'}); 
    }); 
}); 

如jQuery和http://jsfiddle.net/integerz/k19x8L1b/3/具有1.11.x

第一個運作良好。但第二個不是。你能解釋什麼是問題?

  1. With Absolute DIV爲什麼有一個水平滾動條的負右邊距?
+0

查看http://stackoverflow.com/questions/31899245/toggle-in-latest-jquery-releases-has-been-deprecated-beacause-doesnt-work – guest271314

回答

1

看來該功能已停產。

需要做點擊就像這個例子中給出的那樣。

jQuery toggle animation doesn't work on new jQuery

,但不是很知道爲什麼它已經停產了。非常方便。

+1

有一個自動找到解決方案upvote。 –

+0

謝謝。其實我應該更好地尋找其他解決方案的答案。 – VIP

+0

但我仍然想知道爲什麼有一個水平滾動。 – VIP