Image Rollover event : Image Rollover « Ajax Layer « JavaScript DHTML






Image Rollover event

 

http://dynapi.sourceforge.net/
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999

<html>
<head>
<title>DynAPI Examples - HTML Rollover</title>
<script language="JavaScript" src="./dynapisrc/dynapi.js"></script>
<script language="Javascript">
dynapi.library.setPath('./dynapisrc/');
dynapi.library.include('dynapi.api');
dynapi.library.include('HTMLRollover');
</script>
<script language="Javascript">

var off='./dynapiexamples/images/eicon1.gif';
var on='./dynapiexamples/images/eicon2.gif';
var dn='./dynapiexamples/images/eicon3.gif';

hro = new HTMLRollover(null,32,32,off,on,dn);
hro.setBorder(1);
hro.addEventListener({
  onclick:function(e){
    var o=e.getSource();
    alert('Hi, my name is Elco');
    o.cancelEvent(); // cancel event
  }
});

dynapi.document.addChild(hro);


</script>
</head>

<body>
<script>
  dynapi.document.insertAllChildren();
</script>

</body>
</html>


           
         
  








dynapi.zip( 791 k)

Related examples in the same category

1.Image Rollover Demo
2.Photo slide show