Jump to content

javascript help

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
hkp

hkp

    Learning Programmer

  • Members
  • PipPipPip
  • 37 posts
hello friends, I have tried to create that when courser on the image the it show another image. I have used that javascript code. But that is not working can you help me what is the wrong in this code.

<html>

<head>

<script type="text/javascript">

function mouseOver()

{

document.b1.src ="rose1.jpg";

}

function mouseOut()

{

document.b1.src ="rose2.jpg";

}


</head>


<body>


<img border="0" alt="Visit W3Schools!" src="rose1.jpg" name="b1"

onmouseOver="mouseOver()" onmouseOut="mouseOut()" />

</body>

</html>


#2
BlaineSch

BlaineSch

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,448 posts
<html>
<head>
<script type="text/javascript">
function mouseOver(i) {
	i.src = "http://www.olive-trees.net/_borders/Legends%20rose.jpg";
}
function mouseOut(i) {
	i.src = "http://www.boston.com/ae/theater_arts/exhibitionist/miniature-rose-1.jpg";
}
</script>
</head>

<body>

<img border="0" alt="Visit W3Schools!" src="http://www.boston.com/ae/theater_arts/exhibitionist/miniature-rose-1.jpg" id="b1"
onmouseOver="mouseOver(this)" onmouseOut="mouseOut(this)" />
</body>
</html>

Try this on for size.

#3
hkp

hkp

    Learning Programmer

  • Members
  • PipPipPip
  • 37 posts
Thanks for the replay I have tried this code And it is working. Thanks once again to solving my problem..