0
我想要做的是創造,當我鼠標滾輪上/下,動畫運行的開關(但將確保在動畫第一完成之前,第二和第三...)Jquery布爾開關不工作?
什麼我做的是將我的動畫變量設置爲true,並首次運行它,並立即將其切換爲false。
不知何故,條件語句似乎並不奏效.....
我的示例代碼: http://codepen.io/vincentccw/pen/veyAc
//////////////// ////////////////
$("#cropInside").mousewheel(function(event, delta, deltaX, deltaY) {
var boxSlide = document.getElementById("whatEver");
var animationStatus = true;
if ([delta > 0] && [animationStatus==true]){
//code here
animationStatus=false;
console.log(animationStatus);
//call back function after animation complete and set animationStatus=true;
}
if([delta < 0] && [animationStatus==true]){
//code here
animationStatus=false;
console.log(animationStatus);
//call back function after animation complete and set animationStatus=true;
}
});
/////// /////////////////
我注意到你有幾個沒有答案的問題和沒有被接受的答案的問題。我喜歡在他們身上工作。如果您有任何問題,請告訴我! – m59