0

Hi guys,
I am looking for javascript that slides a pointer (an image) from from end to another (left to right) on the movement of the mouse.

I have the navbar and I want the pointer to be on the top so that when the users moves his mouse on the navbar the pointer on the top moves with it - ...
i hope i am explaing this correctly.

I searched and searched but got nowhere so in desperation i am asking the question here.

thanks.. i hope i get some reponses.

vik

3
Contributors
6
Replies
7
Views
12 Years
Discussion Span
Last Post by Tdot
0

hmmm... didnt quite help there Paladine.

any other suggestions?

0

I'm having difficulty understanding the question. What attempts have you made so far to write this script?

If you want to capture the mouse movement and have it fire a JavaScript function, you'll have to use browser-specific code:

// id browsers
var iex=(document.all);
var nav=(document.layers);
var old=(navigator.appName=="Netscape" && !document.layers && !document.getElementById);
var n_6=(window.sidebar);

// capture mouse pointer
if(nav)document.captureEvents(Event.MOUSEMOVE);
if(n_6) document.addEventListener("mousemove",get_mouse,true);
if(nav||iex)document.onmousemove=get_mouse;

Then your "get_mouse" function would perform whatever sliding or navigation event you want, based upon the mouse coordinates captured in the "event" object.

0

The code I posted is the first step. It will watch for the mouse movement, and then fire a JavaScript function when the mouse moves, passing in the coordinates.

Someone will have to write the function to take those coordinates and use them to move your image.

I don't know if there are any pre-built scripts out there, which is what you want.

But the coding itself should be straightforward for a JavaScript programmer.

0

great!!
Thanks tgreer for getting me started on this.. i will look around!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.