PDA

View Full Version : Can some1 plz debug my script?


Antoniohawk
10-13-2002, 06:00 PM
<html>
<head>

<script language="Javascript1.1">
function yaImgChange(imgNum,imgSrc) {
document.images[imgNum].src = imgSrc;
}
</script>

</head>

<body>

<a href="#" onMouseOver="yaImgChange(11,'buttonup.png');" onMouseOut="yaImgChange(11,'buttondown.png');"> <img src="buttonup.png" border="0"></a>

</body>
</html>

Mr J
10-13-2002, 06:39 PM
<script language="Javascript1.1">
function yaImgChange(imgNum,imgSrc) {
document.images[imgNum].src = imgSrc;
}
</script>



<a href="#" onMouseOver="yaImgChange('pic1','buttonup.png');" onMouseOut="yaImgChange('pic1','buttondown.png');"> <img name="pic1" src="buttonup.png" border="0"></a>

adios
10-13-2002, 09:34 PM
<html>
<head>
<script language="Javascript">

function yaImgChange(imgNum,imgSrc) {
document.images.src = imgSrc;
}

</script>
</head>
<body>

<a href="#" onMouseOver="yaImgChange(0,'buttondown.png');" onMouseOut="yaImgChange(0,'buttonup.png');">
<img src="buttonup.png" border="0"></a>
</body>
</html>

You [i]can use the images position in the document.images[] array to roll it; however, it's virtually always done by naming the image (as in the above example) and using that as an index. That way, if you add images, the change in any image's position in the array will be irrelevent.