<script> img#=new Image(width,height); img#.src="URLimage#"> </script> |
/* Preload Images */ <script> img1=new Image(w1,h1);img1.src="URL1"; img2=new Image(w2,h2);img2.src="URL2"; </script> /* To Switch Image */ function swtch() {document.myPic.src=img2.src;return true;} /* To Restore Image */ function restr() {document.myPic.src=img1.src;return true;} </script> <!-- Cursor Rest --> <a href="#1">Rest</a> <!-- Image Placement --> < a href="#1" onMouseOver="swich()" onMouseOut="restr()"> <img src="URL1" name="myPic"> | Rest |
<script> /* Array of IDnames */ var nm=new Array("ID0","ID1","ID2"); /* Array of URLs */ var sngs=new Array("URL0","URL1","URL2"); /* Length of Array */ len=sngs.length; /* Preload Each Tune */ for(i=0;i<len;i++) {document.write('<embed src='+sngs[i]+' autostart="false" hidden="true" name="'+nm[i]+'">');} /* Start Music */ function selct(n){document[nm[n]].play();} /* Stop Music */ function offselct(){document[nm[n]].stop();} /* Check Input */ function doIt() {var m=document.chuz.iwant.value;if(m<len) /* Convert String to Integer */ {m=parseInt(m,10);n=m; /* Call Play Function */ selct(n);} /* Improper Selection */ else{document.chuz.song.value="??";}} </script> |