Mouse Up Down Out Over Click Animate Picture (over image)

[Total: 0    Average: 0/5]

This shows how to have a mouseup, mouseover, mouseclick, mousedown, mouseup event all trigger a picture to change.

Body Code:

<script type=text/javascript>
var _p = "http://www.js-examples.com/js/pic2.gif";
function si(_n) {
  document.images[_n].src = _p;
}
</script>
<BR>Click:<a href="#" onclick="si('clk')"><img name=clk src="http://www.js-examples.com/js/pic1.gif" border=1></a>
<BR>Over:<a href="#" onmouseover="si('mov')"><img name=mov src="http://www.js-examples.com/js/pic1.gif" border=1></a>
<BR>Out:<a href="#" onmouseout="si('mou')"><img name=mou src="http://www.js-examples.com/js/pic1.gif" border=1></a>
<BR>Down:<a href="#" onmousedown="si('md')"><img name=md  src="http://www.js-examples.com/js/pic1.gif" border=1></a>
<BR>Up:<a href="#" onmouseup="si('mu')"><img name=mu  src="http://www.js-examples.com/js/pic1.gif" border=1></a>

Times Viewed: 0

Leave a Reply

Your email address will not be published. Required fields are marked *