[Javascript] Image follows mouse

Troy III Ajnej trojani2000 at hotmail.com
Sat Sep 3 21:26:49 CDT 2005


Thanks anyway, I believe that the script will surely work now,
but you have to tell me,
how did you manage to make the mouse pointer get invisible,
because I'm almost sure that this is why you need this kind of script in the 
first place?!

~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<HTML>
<BODY>
<img src='mypointer.gif' ID="myImage" 
style="position:absolute;top:0px;left:-500px">
</img>
</BODY>
<SCRIPT>
//version 1.0 -Troy III- progresive art enterprise
var h = myImage.height/2;
var w = myImage.width/2
function mousefollower(){
           	x=event.x
	y=event.y
	   myImage.style.posLeft= x-h
	   myImage.style.posTop = y-w }
document.onmousemove=mousefollower
</SCRIPT>
</HTML>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(the corrected [!and tested!] version)


>Thanks very much for that, Troy - I'll work through it.

No need for it now.

>Where are you from ? I often wonder where everyone on the list is from.

I don't that much, but I like the fact that you do.
I'm from Pristina, Ancient Dardania, today a small piece of it: Kosova.

    "we need independence for our survival"

My best regards to you
>Tim in Ireland.
>
>----- Original Message -----
>From: "Troy III Ajnej" <trojani2000 at hotmail.com>
>To: <javascript at LaTech.edu>
>Sent: Saturday, September 03, 2005 12:34 PM
>Subject: RE: [Javascript] Image follows mouse
>
>
> > Not sure if I got you right but try:
> >   1. position your mouse follower image absolutely
> >   2.give it exact height and width.
> >   3. give it some ID (mouseImage)
> >
> > Than do the script
> > It's being written just now...
> >
> > getting center height and width of the image
> > but if you don't like the image to show in center but in right and lower
> > corner of the mouse
> > you might wanna remove the vars and the maths so the script can get even
> > shorter
> > and simplier than this:
> > ...
> >
> > I'm being this nice because you're from Ireland and I'm waiting for some
> > important download to finish 2.
> >
> > P.S. (Use it at your own risk. I never tested it!)
> >
> > Regards
> >            Troy III
> > progressive art enterprise
> >
> >
> > >From: "SkyScanner" <skyscanner at eircom.net>
> > >Reply-To: "\[JavaScript List\]" <javascript at LaTech.edu>
> > >To: "[JavaScript List]" <javascript at LaTech.edu>
> > >Subject: [Javascript] Image follows mouse
> > >Date: Sat, 3 Sep 2005 10:49:18 +0100
> > >
> > >Hi there - in your goody-bag of scripts, has anyone got a script that
>moves
> > >an image around next to the current cursor ? I need one that works in
> > >Internet Explorer *AND* Mozilla.
> > >
> > >Tim in Ireland.
> > >
> > >_______________________________________________
> > >Javascript mailing list
> > >Javascript at LaTech.edu
> > >https://lists.LaTech.edu/mailman/listinfo/javascript
> >
> > _________________________________________________________________
> > Express yourself instantly with MSN Messenger! Download today it's FREE!
> > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
> >
> > _______________________________________________
> > Javascript mailing list
> > Javascript at LaTech.edu
> > https://lists.LaTech.edu/mailman/listinfo/javascript
> >
>
>_______________________________________________
>Javascript mailing list
>Javascript at LaTech.edu
>https://lists.LaTech.edu/mailman/listinfo/javascript

_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar - get it now! 
http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/




More information about the Javascript mailing list