
Sep 4th, 2007, 01:26
|
|
Junior Member
|
|
Join Date: Aug 2006
Location: New Jersey
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
|
Re: dual random image genetator...tricky
still no go...
updated code
- Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<!--[if lt IE 7.]>
<script defer type="text/javascript" src="pngfix.js"></script>
<![endif]-->
<style type="text/css">
<!--
body {
background-color: #CCCCCC;
}
-->
</style>
<link href="default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" language="JavaScript">
NumberOfImagesToRotate = 2;
FirstPart = 'url (images/back';
LastPart = '.jpg)';
index ='t';
r = Math.ceil(Math.random() * NumberOfImagesToRotate);
function printImage() {
//after loading the id's into variables you could almost get rid of the
//second function
document.getElementById('tableCell1').style.backgroundImage = FirstPart + r + LastPart;
document.getElementById('tableCell2').style.backgroundImage = FirstPart + r + index + LastPart;
}
//-->
</script>
</head>
<body class="bg" topmargin="0" marginheight="0">
<table width="800" align="center"height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="200" id="tableCell1">
<div class="logo"><a href="index.html"><img src="images/logo.png" /></a></div>
<div id="navs"><a href="repair.html" class="navs">computer repair</a></div>
<div id="navs"><a href="hosting.html" class="navs">web hosting</a></div>
<div id="navs"><a href="design.html" class="navs">design</a></div>
<div id="navs"><a href="repair.html" class="navs">data backup</a></div>
<div id="navs"><a href="training.html" class="navs">computer training</a></div>
<div id="navs"><a href="contact.html" class="navs">contact</a></div></div>
</td>
</tr>
<tr>
<td bgcolor="#CCCCCC">Lorwm aasdasda asd asd asd asd asd asd as das Lorwm aasdasda asd asd asd asd asd asd as das Lorwm </td>
</tr>
<tr>
<td height="100" id="tableCell2"><div class="footer"><img src="images/copyright.png" /></div></td>
</tr>
</table>
</body>
</html>
are the id's right
|