0
我用jQuery製作了自己的滑塊,使用了.animate函數,當我使用它一次和兩次時,滑塊就可以工作,但在第三次嘗試時,它變得瘋狂!基本上它類似於微軟的'For Home'和'For Work'滑塊,但是不那麼複雜(現在)jQuery滑塊只能工作兩次?
它住在一個網站上,並向你展示我的意思,這裏是網址: http://glorbi.com/index3
(點擊查看工作,那麼對於家庭,然後工作,它開始失敗)
這裏是jQuery的處理該滑動:
$("#sidebar2").click(function(){
$("#innerSec2").animate({"right" : 130}, 1000);
$("#sidebar2").animate({"height" : 1100});
$("#innerSec").animate({"left" : -840}, 1000);
$("#innerSec").animate({"left" : 840}, 200);
$("#sidebar").animate({"height" : 400});
});
$("#sidebar").click(function(){
$("#innerSec").animate({"left" : 0}, 1000);
$("#sidebar").animate({"height" : 1100});
$("#innerSec2").animate({"right" : 970}, 1000);
$("#innerSec2").animate({"left" : 710}, 200);
$("#sidebar2").animate({"height" : 400});
});
我使用回調試過,但他們導致更順序的反應離子,移動滑塊的部分,這看起來非常可怕。
另外我知道z-index問題,因爲它滑動,我會解決這個問題!
有誰知道我該如何解決這個問題?代碼非常通用,對每一個操作都是嚴格的值,我真的不知道它是如何失敗的。 :S
非常感謝!任何幫助是極大的讚賞! :)
我愛你。非常感謝! :) – Karan