Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript_howto thread: Swapping Sliced Images


Message #1 by "Gregory Reddin" <greddin@t...> on Fri, 22 Nov 2002 04:54:19
Here is a sample page for you - the ?? are for your images and the 
widths and heights

this should  be your "fix" works xbrowser

regards
idaryl
http://www.designedimage.com

-------------------------------


<html>
<head>
<title>Untitled Document</title>
<script language="JavaScript">

<!--change images
function change()
{
number = Math.floor(Math.random()*9)
if (number==0)
document.write('<img src="here_??" width="??" height="??" 
border="0">')
if (number==1)
document.write('<img src="here_??" width="??" height="??" 
border="0">')
if (number==2)
document.write('<img src="here_??" width="??" height="??" 
border="0">')
if (number==3)
document.write('<img src="here_??" width="??" height="??" 
border="0">')
if (number==4)
document.write('<img src="here_??" width="??" height="??" 
border="0">')
if (number==5)
document.write('<img src="here_??" width="??" height="??" 
border="0">')
if (number==6)
document.write('<img src="here_??" width="??" height="??" 
border="0">')
if (number==7)
document.write('<img src="here_??" width="??" height="??" 
border="0">')
if (number==8)
document.write('<img src="here_??" width="??" height="??" 
border="0">')
}
//--end change
</script>
</head>

<body bgcolor="#FFFFFF" text="#000000">
<table width="50%" border="0" cellspacing="0" cellpadding="0" 
height="95">
  <tr> 
    <td width="29%">&nbsp;</td>
    <td width="40%"> 
      <script>change()</script>
    </td>
    <td width="31%">&nbsp;</td>
  </tr>
</table>
<p>&nbsp;</p>
<p>OK there are three columns here - make sure your image - 
whatever column it 
  fits, the td size is the same (in pixels!!)</p>
<p>also the script has [number = Math.floor(Math.random()*9)] the 9= 
the amount 
  of images you want to random through<br>
  this randoms through 8 images - the code uses 0 as a setup</p>
<p>&nbsp;</p>
<p>check out http://www.authenticrock.com I used this script for 
them</p>
</body>
</html>

  Return to Index