| Off Topic > Off Topic |
| Javascript Code for Rotating images? |
| << < (2/2) |
| SuperToxic:
I cannot use PHP on the Webserver. I can however use HTML to place Javascript code. Which is what I wanted in the first place ;-; |
| Ephialtes:
HTML doesn't allow images to be rotated. You won't be able to do this using HTML or JavaScript without using a hideous hack that slows down your page load and probably won't be cross-browser compatible. |
| SuperToxic:
Aha found it. For those of you wondering, it's: --- Code: ---<script language="JavaScript"> <!-- function random_imglink(){ var myimages=new Array() //specify random images below. You can have as many as you wish myimages[1]="img1.gif" myimages[2]="img2.gif" myimages[3]="img3.gif" //specify corresponding links below var imagelinks=new Array() imagelinks[1]="http://www.wsabstract.com" imagelinks[2]="http://www.dynamicdrive.com" imagelinks[3]="http://www.java-scripts.net" var ry=Math.floor(Math.random()*myimages.length) if (ry==0) ry=1 document.write('<a href='+'"'+imagelinks[ry]+'"'+'><img src="'+myimages[ry]+'" border=0></a>') } random_imglink() //--> </script> --- End code --- |
| Navigation |
| Message Index |
| Previous page |