javascript - preloading issue on ipad -
i want preload 152 jpg images 7 animations.i trying run individual animation images required animation(ex first 40 images) has preloaded.in browser it's working fine in android also.but in ipad, animation(background-image changing) not running smoothly untill 152 images won't preload.
function preload(arguments,index) { console.log(index) for(var i=1;i<=eval(imagesperscreen[index][1]-imagesperscreen[index][0]+1);i++){ scheen[index][i-1] = new image(); scheen[index][i-1].src = arguments[index][eval(i-1)]; $(scheen[index][i-1]).load(function(){ imgloaded++; var percent=parseint((imgloaded/(imagesperscreen[index][1]-imagesperscreen[index][0]+1)*100).tofixed())+8; if(!isipad){ //document.getelementbyid("loadingstatus").innerhtml="loading.. "+percent+"%"; $("#loadingstatus").css('width',percent+'px'); } else{ //$("#loadingstatus").css('display','none'); $("#loadingstatus").css('width',percent+'px'); } }); } scheen[index][eval(imagesperscreen[index][1]-imagesperscreen[index][0])].onload= function() { ++screenloaded; imgloaded=0; $("#rightbutton").css('display','block'); $("#rightarea").css('display','block'); $("#loadingstatus").css('display','none'); $("#status").fadeout("fast"); $("#preloader").fadeout("fast"); if(waiting){movenext();} if(screenloaded<7){ preload(pics,index+1) } }; }
Comments
Post a Comment