JavaScript Forum JS Made Easy: Free JavaScripts Tutorials Example Code
About This Product
FontsMadeEasy.com
 
The Business Internet
Find it on This page:
 
| Over 5000 Free Fonts | Tutorials | Javascript Forum | Other Javascript Resources | Cheat Sheet

     
Jsmadeeasy Forums Home   Search   Login   Register   Member List  
JS Made Easy  > JavaScript programming  > Re:  
 
Display using:  
Previous Thread :: Next Thread 
 Author Thread: Changing the "Eyes"-Script a little bit
matthias is not online. Last active: 7/28/2004 3:52:08 PM matthias
Top 100 Poster
Joined: 28 Jul 2004
Total Posts: 2
 
Changing the "Eyes"-Script a little bit
Posted: 22 May 2002 05:17 AM
Hello everybody,

at http://www.jsmadeeasy.com/javascripts/cursor%20effects/list.htm I found the "Eyes"-Script whitch is indeed very amazing.

I now would like to change the script so that the eyes would not follow the cursor around the screen but only look at the cursor from a fixed position.

Here are my changes in the script. I would like the pupils not to leave the the "white" area. But that's the case in my script. The pupils move right into the four "corners"


// ae.left = x0;
// ae.top = y0;
ae.left = 200;
ae.top = 200;

// le.left = dx1
// re.left = dx2

if(dy1<=200) {
dy1 = 200;
} else {
if(dy1>=220) {
dy1 = 220;
}
}

le.top = dy1;
re.top = dy1;

if(dx1<=200) {
le.left = 200;
} else {
if(dx1>=220) {
le.left = 220;
} else {
le.left = dx1
}
}

What must I change so that the pupils do not leave the white area?

Thanks for any help on that.


Matthias

qsaaiman is not online. Last active: 5/30/2006 4:23:08 AM qsaaiman
Top 25 Poster
Joined: 28 Jul 2004
Total Posts: 21
 
Re:
Posted: 22 May 2002 05:56 AM
Hey. It's quite simple.

in the function setHandlers() just remove the last entry that reads "moveall();" and if you want you can remove the moveall() function.

if you want to control where they are on the page modify the placeeyes(x, y) function.

HTH

Quintin Saaiman
Department of Labour
IT Systems

Quintin Saaiman
matthias is not online. Last active: 7/28/2004 3:52:08 PM matthias
Top 100 Poster
Joined: 28 Jul 2004
Total Posts: 2
 
Re:
Posted: 22 May 2002 06:31 AM
Hey Quintin,

thank you very much. That's exactly what I was looking for. I'm a newbee in JS so I didn't saw this easy way.


Matthias

Previous Thread :: Next Thread 
Goto to page:  Prev Next
 
Jsmadeeasy.com  > JS Made Easy  > JavaScript programming  > Re: