Eyes script snippet


This is the javascript that makes the eyes move: eyes.js and the html code used in the demo above (<iframe>):

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "//www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-US" xml:lang="en-US" xmlns="//www.w3.org/1999/xhtml">
<head>
<script type="text/javascript" src="eyes.js"> </script>
<style type="text/css">
img {
visibility:hidden;
position:absolute;
}
</style>
</head>
<body>

<div style="width:100%;height:100%" onmousemove="mousemove(event)">
<img alt="re" src="eye.png" id="RE" style="top:30px; left:110px"/>
<img alt="rp" src="pupil.png" id="RP" style="top:85px; left:140px"/>
<img alt="le" src="eye.png" id="LE" style="top:30px; left:10px"/>
<img alt="lp" src="pupil.png" id="LP" style="top:85px; left:40px"/>
</div>

</body>
</html>