|
Hi all -
I'm VERY new to javascript, so please bear with me. I'm sure this is easy to do, but I've been searching around and can't figure out how to link the different elements of what I am trying to do.
I've managed to get a script working that changes the image shown in a particular location when you hover over a link. (This is using tables for now - the CMS I work in doesn't allow creation of new styles, so please forgive that). This is what I have so far:
***
<html>
<head>
<title>Javascript Test</title>
<script language="JavaScript" type="text/JavaScript">
function showT(q){
document.getElementById('photo').setAttribute('src ','0'+ q + '.jpg')
}
</script>
</head>
<body>
<table width="500" border="0">
<tr>
<td width="20%">
<a href="#" onmouseover="showT(0)" title="physician">pic 1
<br> <br>
</a>
<a href="#" onmouseover="showT(1)" title="mouse">pic 2
<br> <br>
</a>
<a href="#" onmouseover="showT(2)" title="flower">pic 3</a>
</td>
<td><a href="#" javascript:><img id="photo" src="H:\Javascript\stimulus\00.jpg" width="100" height="100"></a></td>
</tr>
</table>
</body>
</html>
***
I seem to have lost most of my post as I edited...
What I want to do is assign different urls to the different images shown. For example, I want the image to link to one url when hovering over the link named physician, another specific url when hovering over the link named mouse and another specific url when hovering over the link named flower.
Thanks so much in advance!
__________________
"If you worried about falling off the bike, you'd never get on it" - Lance Armstrong
"The problem with people who have no vices is that generally you can be pretty sure they're going to have some pretty annoying virtues." - Elizabeth Taylor
Last edited by lynnema; 03-18-2009 at 11:56 AM..
|