javascript - Animation Not Proper starting -


i clock animation works use setinterval call function. animation has little delay while start[ stops time on 12]

var timemin=0; var timehr=0; var timesec=0; var a=0; function clockrotate(){ timemin=timemin+6; timehr=timehr+0.5; timesec=timesec+360; $("#cimg3").animate({rotate:timemin},2500); $("#cimg4").animate({rotate:timesec},2500); $("#cimg2").animate({rotate:timehr},2500); }  setinterval(function(){ clockrotate(); a=1; },0*2500); 

see action here

how can remove delay. thanks

you should use "linear". default "swing" makes animation slower @ beginning , end. animate documentation

var timemin=0; var timehr=0; var timesec=0; var a=0; function clockrotate(){     timemin=timemin+6;     timehr=timehr+0.5;     timesec=timesec+360;     $("#cimg3").animate({rotate:timemin},2500,"linear");     $("#cimg4").animate({rotate:timesec},2500,"linear");     $("#cimg2").animate({rotate:timehr},2500,"linear"); }  setinterval(function(){     clockrotate();     a=1; }, 0*2500); 

fiddle


Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -