View Single Post
Old 01-30-2005, 02:55 PM   #2 (permalink)
ender
Code Monkey
 
ender's Avatar
 
Join Date: Mar 2003
Location: Evansville, IN
Posts: 75
ender is on a distinguished road
Send a message via AIM to ender Send a message via Yahoo to ender
Code:
function findObj(objID){ return document.getElementById?document.getElementById(objID):document.all?document.all[objId]:null; }

function changeImage(newImgSrc) {
    var newImg = findObj("newImg");    
    if (!newImg) return;

    newImg.src = newImgSrc;
}
The HTML that could go with this is:

Code:
<html>
<head>
<script><!-- INSERT SCRIPT HERE --></script>
</head>
<body>

<table>
<tr>
    <td>
        <span id="oldImg" onmouseover="changeImg('newImg.jpg');">A cell</span>
    </td><td>
        <img id="newImg" src="oldmg.jpg">
    </td>
</tr>
</table>

</body>
</html>
Obviously this might need some work to make it more exensible.. but the base code is there. Furthermore, I don't know if you need the image to change back after the mouse leaves as well.

If you need more info, just ask.

-Ted
__________________
while(1) fork();

Last edited by ender; 01-30-2005 at 03:03 PM. Reason: code error .. arrg
ender is offline   Reply With Quote