Mouse Up Down Out Over Click Animate Picture

[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>
<a href="#" onclick="si('clk')">click me</a>
<a href="#" onmouseover="si('mov')">mouse over me</a>
<a href="#" onmouseout="si('mou')">mouse out of me</a>
<a href="#" onmousedown="si('md')">mouse down</a>
<a href="#" onmouseup="si('mu')">mouse up</a>
<BR>Click: <img name=clk src="http://www.js-examples.com/js/pic1.gif">
<BR>Over:  <img name=mov src="http://www.js-examples.com/js/pic1.gif">
<BR>Out:   <img name=mou src="http://www.js-examples.com/js/pic1.gif">
<BR>Down:  <img name=md  src="http://www.js-examples.com/js/pic1.gif">
<BR>Up:    <img name=mu  src="http://www.js-examples.com/js/pic1.gif">

Times Viewed: 0

Leave a Reply

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