Add mouse down, over, up and out event to an image
http://dynapi.sourceforge.net/
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
<html>
<head>
<title>DynAPI Examples - Functions</title>
<script language="JavaScript" src="./dynapisrc/dynapi.js"></script>
<script language="Javascript">
dynapi.library.setPath('./dynapisrc/');
dynapi.library.include('dynapi.library');
dynapi.library.include('dynapi.functions');
dynapi.library.include('dynapi.api');
</script>
</head>
<body>
<font face="arial" size="2">
<script>
var doc=document;
f=dynapi.functions;
// very simple mouse down & over setup
var params={};
params.tooltip="Click here";
params.oversrc="./dynapiexamples/images/oversrc.gif";
params.downsrc="./dynapiexamples/images/downsrc.gif";
params.onclick=function(){alert('Hello!')};
params.onmouseover="status='Over!'";
params.onmouseout="status='Out!'";
params.onmousedown="status='Down!'";
params.onmouseup="status='Up!'";
var img=f.getImage('./dynapiexamples/images/src.gif',95,15,params)
doc.write('getImage: '+img.getHTML());
doc.write(' '+img.getHTML({tooltip:"Another Image",onclick:"alert('Hello Again!')"})+'<br><br>');
</script>
</font>
</body>
</html>
dynapi.zip( 791 k)Related examples in the same category