»
AnglaisFran�aisVietnamien

Imprimer - Image Preloader MKII - JavaScriptBank.com

Version compl�te: jsB@nk » Image » Image Preloader MKII
URL: https://www.javascriptbank.com/image-preloader-mkii.html

Image Preloader MKII © JavaScriptBank.comImage Preloader MKII permet de s'assurer que toutes vos images sont téléchargées avant de les utiliser.

Version compl�te: jsB@nk » Image » Image Preloader MKII
URL: https://www.javascriptbank.com/image-preloader-mkii.html



JavaScript
<SCRIPT language=javascript><!--// Realised by ApacheJeff// www.huntingground.freeserve.co.ukimages=new Array("logojs.gif","logojs.gif","logojs.gif","logojs.gif","logojs.gif")img_total=images.length // counter displaya_index=0var preloaded=new Array()function load_image(){preloaded[a_index]=new Image()preloaded[a_index].onload=check_arraypreloaded[a_index].src=images[a_index]}function check_array(){document.display_img.src=images[a_index] // image displaydocument.getElementById("info").innerHTML="Loading "+img_total // counter displayimg_total-- // counter displaya_index++progress() // progress bar displayif(a_index!=images.length){setTimeout("load_image()",10)}else{document.getElementById("info").innerHTML="" // counter displaydocument.getElementById("progress_bar").style.visibility="hidden" // progress bar displaydocument.getElementById("bg_layer").style.visibility="hidden" // progress bar displaydo_this() // function to run}}// progress bar displayWidth=300 // width of barstep_size=Width / images.length // calculates step sizestep=0function progress(){step+=(step_size*1)document.getElementById("progress_bar").style.width=step}function do_this(){alert("All the images have now been downloaded")}// add onload="load_image()" to the opening BODY tag//--></SCRIPT><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<BODY onload=load_image()><DIV id=bg_layer style="FONT-SIZE: 10px; LEFT: 180px; WIDTH: 300px; POSITION: absolute; TOP: 145px; BACKGROUND-COLOR: #8e8462"></DIV><DIV id=progress_bar style="FONT-SIZE: 10px; Z-INDEX: 2; LEFT: 180px; WIDTH: 0px; POSITION: absolute; TOP: 145px; BACKGROUND-COLOR: #c9bda9"></DIV></BODY><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->