/* jseyes.js
The classic Xeyes in JavaScript
(c) PROPIX Ltd, Written by Pintér Gábor
Székesfehérvár, Kriványi u. 15.
H-8000, HUNGARY
Tel: +36 30 3489752
Fax: +36 22 304326
Email: propix@freemail.hu
Web: http://www.propix.hu
Revisions:
V1.0 10/14/2001 Original release
V1.1 02/20/2008: Updated by JavaScriptKit.com to work in the latest browsers (IE7, FF etc)
Usage:
1. Include this file from the head of your page
2. Define parameters or accept the defaults
3. Insert the image
This script requires Internet Explorer 5+ or Nescape Navigator 6+! In other browsers it does nothing.
1. Include jseyes.js from the head of your page
Insert the following line into the head of your page:
2. Define parameters
You can accept the defaults or assign new values to these variables:
jseyesimg="jseyes.gif"
The main image. Please do not edit.
jseyeimg="jseyeblue.gif"
The image of the eye. Must be a 21x29 solid ellipse with transparent background.
4. Insert the image
Call jseyes() where you want to see the image:
Or call jseyes(x, y) to show the image at absolute position:
Example: http://www.propix.hu/www/jseyes/jseyes.html
*/
// Defaults
var jseyesimg="jseyes.gif";
var jseyeimg="jseyeblue.gif";
var jseyeslink="http://www.javascriptkit.com";
// Internal
var jseyeso=null, jseye1=null, jseye2=null;
var standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body //create reference to common "body" across doctypes
// General utils
// Find object by name or id
function jseyesobj(id) {
var i, x;
x= document[id];
if (!x && document.getElementById) x= document.getElementById(id);
for (i=0; !x && i"+
""+
"
"+
"
"+
""+
"
"+
"
"+
""+
"";
document.write(img);
jseyeso=jseyesobj('jseyeslayer');
jseye1=jseyesobj('jseye1');
jseye2=jseyesobj('jseye2');
document.onmousemove=jseyesmousemove;
}
// Mouse move events
function jseyesmousemove(e) {
var mousex=(e)? e.pageX : event.clientX+standardbody.scrollLeft
var mousey=(e)? e.pageY : event.clientY+standardbody.scrollTop
jseyesmove(mousex, mousey);
//return(false);
}