Click to See Complete Forum and Search --> : dynamic css cursor problem


Sam
10-01-2003, 06:02 PM
document.write('<div id=toolbarmove style="position:absolute;left:0;top:0"><img src="c_hair.gif" onclick="zImg.style.cursor=\'move\'" alt="Click then drag the map to view different portions"></div>');
document.write('<div id=toolbarzplu style="position:absolute;left:0;top:22"><img src="magp.gif" onclick="zImg.style.cursor=\'url(mag.cur)\'" alt="Click a point to zoom in on it"></div>');
document.write('<div id=toolbarzmin style="position:absolute;left:0;top:44"><img src="magm.gif" onclick="zImg.style.cursor=\'url(magm.cur)\'" alt="Click a point to zoom out from it"></div>');

I am running the preceding code snippet to change the cursor on click of an item while the mouse is over 'zImg'
It works fine the first time each is clicked, but after that it stops... any idea on how to fix this?

Sam
10-02-2003, 10:49 AM
It seems like the thing is somehow dying after it changes cursors once. If I change the default cursor style on one of those divs to pointer, after it normally would die, it just sticks on the pointer, even though I never define pointer for zImg

aoeguy
10-02-2003, 11:02 AM
cursor.style='hand'

I used that on http://gamesnetwork.e33.de
The table on the left when you have entered.

Sam
10-02-2003, 03:09 PM
I couldn't view the source on that site, whats the exact syntax?

pyro
10-02-2003, 03:19 PM
hand is not a valid value for the cursor property. Use pointer, instead: http://www.w3.org/TR/REC-CSS2/ui.html#cursor-props

Sam
10-02-2003, 03:25 PM
I thought so... I was using pointer... here's a link to the temp directory of the page so you can see the prob for yourself
http://www.medford.k12.or.us/sample/
In the top left (currently only IE compliant),
click the magnify + icon, then mouseover the big image, then click the magnify - icon, then mouseover the big image, finally, click the mag + icon again, and mouseover the big image. The third click reverts the cursor to the default pointer. view source at page to see if you can figure out why.
Thanks in advance

Sam
10-03-2003, 03:41 PM
any ideas?

aoeguy
10-13-2003, 11:42 AM
SIMPLE!

Hand does work :rolleyes:

code:

onmouseover="cursor.style='hand';return true"

Add it in to the image or whatever code

i.e.

<img src="" [code here]>

pyro
10-13-2003, 12:04 PM
Originally posted by aoeguy
Hand does work :rolleyes:Did you try it in Mozilla or Netscape? curosr: pointer works in all of them (as it is the correct way to do it).

aoeguy
10-13-2003, 01:00 PM
Mozzilla is the code name for IE isnt it? I havnt got stupid netscape navigator

pyro
10-13-2003, 01:34 PM
http://www.mozilla.org/

craigm
04-29-2005, 05:55 PM
It seems like the thing is somehow dying after it changes cursors once. If I change the default cursor style on one of those divs to pointer, after it normally would die, it just sticks on the pointer, even though I never define pointer for zImg

I'm having the exact same problem. I can set the cursor fine the first time, but subsequent calls don't change the pointer. I noticed that this only happens if I am using "url()" pointers. If I use a builtin pointer such as "crosshair" then it works fine.

Did you ever resolve this issue? I noticed you abandoned the thread and it sort of took on a life of its own. :-D