Created
June 19, 2014 03:11
-
-
Save kuc-arc-f/96bb395c30943666be86 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CustomSlide.start_anim = function (image, msec ) { | |
var ixSt = mWidthSlide; | |
var ix = 0; | |
var imx = msec / mDuration; | |
var ixDf = ixSt / imx; | |
console.log('imx='+ imx + ',ixDf=' +ixDf +',ipos='+ mPosition_Slide ); | |
setTimeout(function(){ | |
function gravity() { | |
mContext.clearRect(0, 0, mWidthSlide, mHeightSlide); | |
var iposX= ixSt - (ix * ixDf); | |
// console.log('iposX =' + iposX ); | |
var iposY= CustomSlide.get_positinY(image); | |
mContext.drawImage(image, iposX, iposY, image.width, image.height); | |
if(iposX < 0){ | |
clearInterval(g); | |
$(this).delay( mNUM_WAIT_AFT ).queue(function() { | |
CustomSlide.display_anim( mPosition_Slide +1 ); | |
$(this).dequeue(); | |
}); | |
} | |
ix++; | |
}; | |
var g = setInterval(gravity, mDuration); | |
}, 100 ); | |
}; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment