I've programmed an image to "look" at the cursor, wherever it is. Here is the source for the image in the <Body>
[tt]
<img src="images\straight.gif" name="follower">
[/tt]
Here is the code that is called by onmousemove event:
[tt]
Looker = new Array(
"images/straight.gif",
"images/up.gif",
"images/upright.gif",
"images/right.gif",
"images/downright.gif",
"images/down.gif",
"images/downleft.gif",
"images/left.gif",
"images/upleft.gif"
);
function mousefollow() {
getmousexy();
if (xmouse > (ximage+45)) {
if (ymouse > (yimage + 60)) document.follower.src=Looker[4];
else if (ymouse < (yimage - 60)) document.follower.src=Looker[2];
else document.follower.src=Looker[3];
}
else if (xmouse < (ximage-45)){
if (ymouse > (yimage + 60)) document.follower.src=Looker[6];
else if (ymouse < (yimage - 60)) document.follower.src=Looker[8];
else document.follower.src=Looker[7];
}
else {
if (ymouse > (yimage + 60)) document.follower.src=Looker[5];
else if (ymouse < (yimage - 60)) document.follower.src=Looker[1];
else document.follower.src=Looker[0];
}
}
[/tt]
I've tried every pre-load image routine I can find. The thing is that even after an particular image has been viewed it still has a delay while it goes back to the web to reload it every time it changes. I'm stumped.
My cache is large enough...any other ideas?
Jonathan
________________________________________
It is not fair to ask of others what you are unwilling to do yourself.
-Eleanor Roosevelt
[tt]
<img src="images\straight.gif" name="follower">
[/tt]
Here is the code that is called by onmousemove event:
[tt]
Looker = new Array(
"images/straight.gif",
"images/up.gif",
"images/upright.gif",
"images/right.gif",
"images/downright.gif",
"images/down.gif",
"images/downleft.gif",
"images/left.gif",
"images/upleft.gif"
);
function mousefollow() {
getmousexy();
if (xmouse > (ximage+45)) {
if (ymouse > (yimage + 60)) document.follower.src=Looker[4];
else if (ymouse < (yimage - 60)) document.follower.src=Looker[2];
else document.follower.src=Looker[3];
}
else if (xmouse < (ximage-45)){
if (ymouse > (yimage + 60)) document.follower.src=Looker[6];
else if (ymouse < (yimage - 60)) document.follower.src=Looker[8];
else document.follower.src=Looker[7];
}
else {
if (ymouse > (yimage + 60)) document.follower.src=Looker[5];
else if (ymouse < (yimage - 60)) document.follower.src=Looker[1];
else document.follower.src=Looker[0];
}
}
[/tt]
I've tried every pre-load image routine I can find. The thing is that even after an particular image has been viewed it still has a delay while it goes back to the web to reload it every time it changes. I'm stumped.
My cache is large enough...any other ideas?
Jonathan
________________________________________
It is not fair to ask of others what you are unwilling to do yourself.
-Eleanor Roosevelt