Click to See Complete Forum and Search --> : Need help with cursor script


shmeeps
08-27-2003, 08:52 PM
I need to make it so that When your viewing my webpage you can click on a button and it will change the curosr. Can anyone help?

gcrowan
08-27-2003, 09:33 PM
<button onClick="style.cursor='hand';">Click Here</button>
If you want you can have it cycle through and array of styles and change everytime you click.

if you want the default cursor style for the body or any page element to change:
<button onClick="body.style.cursor='hand';">Click Here</button>

pyro
08-27-2003, 10:56 PM
The hand property for the cursor is incorrect. It should be pointer. See http://www.w3.org/TR/REC-CSS2/ui.html#cursor-props for more information on which properties are valid.

gcrowan
08-28-2003, 12:23 AM
You can save this for a quick reference.

Copy and paste to view this HTML page.

<html>
<body>

<p>Move the mouse over the words to see the cursor change</p>

<span style="cursor: auto">
Auto</span><br>
<span style="cursor: crosshair">
Crosshair</span><br>
<span style="cursor: default">
Default</span><br>
<span style="cursor: hand">
Hand</span><br>
<span style="cursor: move">
Move</span><br>
<span style="cursor: e-resize">
e-resize</span><br>
<span style="cursor: ne-resize">
ne-resize</span><br>
<span style="cursor: nw-resize">
nw-resize</span><br>
<span style="cursor: n-resize">
n-resize</span><br>
<span style="cursor: se-resize">
se-resize</span><br>
<span style="cursor: sw-resize">
sw-resize</span><br>
<span style="cursor: s-resize">
s-resize</span><br>
<span style="cursor: w-resize">
w-resize</span><br>
<span style="cursor: text">
text</span><br>
<span style="cursor: wait">
wait</span><br>
<span style="cursor: help">
help</span><br>

</body>
</html>

pyro
08-28-2003, 07:01 AM
Originally posted by gcrowan
<span style="cursor: hand">
Hand</span><br>Apparently you didn't read what I said. Let me try again:

Originally posted by pyro
The hand property for the cursor is incorrect. It should be pointer. See http://www.w3.org/TR/REC-CSS2/ui.html#cursor-props for more information on which properties are valid.That means it should be:

<span style="cursor: pointer">Pointer</span>

Also, you could just bookmark the page I liked to...

shmeeps
08-28-2003, 07:00 PM
Thanks alot guys. :D

gcrowan
08-28-2003, 10:25 PM
I believe what Pyro is so eloquently trying to state is that the hand property is depreciated and will no longer be included in future versions of HTML. Thanks for the heads up, P.

pyro
08-28-2003, 10:31 PM
You bet, though what I was actually stating is that cursor: hand never was valid. It is proprietary code... And one other minute point, just to nit-pick, is that the cursor property is part of CSS, not HTML... :)