jak zrobic preloader do 1 pliku graficznego, ktory podczas wczytywania go pokaze w miejscu obrazka inny obrazek ?(np loading.gif)
i aby dzialal pod najpopularniejszymi przegladarkami typu ie ff opera etc
<?php <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Image Preloader</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <script language="JavaScript" type="text/JavaScript"> <!-- window.onerror = doNothing; function doNothing(){ return true; } preloader(); var image1 = new Image; image1.src = "duze.jpg"; var begin = true; image1.onload = picPlacer; var messages = new Array("Your images are loading","Your images are loading.","Your images are loading..","Your images are loading...","Your images are loading..","Your images are loading."); var counter = 0; function preloader(){ if(begin==true) if(document.getElementById){ document.getElementById("holder").innerHTML = "<font color="#000000">"+messages[counter]+"</font>"; }else if(document.all&&!document.getElementById){ document.all.holder.innerHTML = "<font color="#000000">"+messages[counter]+"</font>"; } counter++; if(counter==6){ counter = 0; }homer = setTimeout("preloader()",200); } function picPlacer(){ if(document.getElementById){ document.getElementById("picplacer").src = image1.src; document.getElementById("picplacer").style.height = "250"; document.getElementById("holder").innerHTML=''; }else if(document.all&&!document.getElementById){ document.all.picplacer.src = image1.src; document.all.picplacer.style.height = "250"; document.all.holder.innerHTML=''; } clearTimeout(homer); } //--> </script> </head> <body> <table width="50%" border="0" align="center" style="font-family:Verdana,sans-serif;font-size:11px"> <tr> <td align="center" valign="top"><img src="spacer.gif" name="picplacer" id="picplacer"></td> </tr> <tr> <td align="left" valign="top"><span id="holder"> </span></td> </tr> </table> </body> </html> ?>
tutaj ma okreslone wymiary.. ale gry usune z kodu ten fragment
to zdjecie otwiera sie w okreslonych rozmiarach tzn 200x150 ale z koleji nie preloaduje sie;/ jak ustawic (podejrzewam ze gdzies w pliku preloader-0.1.js) aby kazde preloadowane zdjecie mialo rozmiar np 200x150 ?