Skip to content

Instantly share code, notes, and snippets.

@kuc-arc-f
Created June 19, 2014 03:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kuc-arc-f/96bb395c30943666be86 to your computer and use it in GitHub Desktop.
Save kuc-arc-f/96bb395c30943666be86 to your computer and use it in GitHub Desktop.
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