Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding Hyperlink to Changing Images

Status
Not open for further replies.
Jul 4, 2004
42
0
0
GB
Hi,

I use the code below to change automatically two images on a webpage. I want the images to be hyperlinkable when they appear. I have tried to put the href in a couple of places but it dont seam to work. Can anyone help please.

<style type="text/css">
body {position:relative; z-index:0}
td#Pics {width:150px; height:80px; vertical-align:top}
img#kidscando {position:absolute; border:0px; width:150px; height:80px; z-
index:2}
img#pkhd {position:absolute; border:0px; width:150px; height:80px; z-index:1}
</style>

<script type="text/javascript">
var A=2;
var B=1;
var Temp;

function beChanging()
{
Temp=B; B=A; A=Temp;

document.getElementById('kidscando').style.zIndex = A;
document.getElementById('pkhd').style.zIndex = B;
setTimeout("beChanging()",3000);
}

</script>
<body onload="beChanging()">
<table cellpading="0" cellspacing="0" border="0">
<tbody>
<tr>
<td width="0">
</td>
<td id="Pics">
<img src="images\kidscanddo.gif" id="kidscando">
<img src="images\PKHD_online_logo_150x60px.png" id="pkhd">
</td>
<td>
</td>
</tr>
</tbody>
</table>

Thank you....
John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top