|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
Hi All,
I have the following code that goes nutz when I load page. Error shows up at Document.images[ImgNum].src = imgSrc Heres the code: Code:
<html>
<head><title></title>
<script language="JavaScript1.1" type="text/JavaScript">
<!--
*
function yaImgChange(imgNum,imgSrc)
{
document.images[imgNum].src = imgSrc;
}
*-->
</script>
<body>
<br><br><br>
<a href="javascript:nothingMuch();" onMouseOver="yaImgChange(11,'calendar.gif');" onMouseOut="yaImgChange(11,'Calender2.gif');"> <img src="calendar.gif"></a>
</body>
</html>
What am I doing wrong? Thanks, JJ |
|
#2
|
|||
|
|||
|
Code works fine, perhaps it's not the 12th image. Remember in JavaScript arrays and collections start at 0, not 1.
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > Rollover Function Broken |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|