• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2588
  • Last Modified:

onMouseOver and the cursor

In my <TH> tag I want to do:

<TH id="th1" onMouseOver="this.style='cursor:hand';" >Company</TH>

and then have the cursor return to the default on onMouseOut. But I have been trying a number of variations on the setting for onMouseOver and so far none of them owrk, plenty of syntax errors though.
0
RichardFox
Asked:
RichardFox
  • 2
  • 2
  • 2
  • +2
1 Solution
 
GrandSchtroumpfCommented:
<TH id="th1" onMouseOver="this.style.cursor='hand';" >
0
 
GrandSchtroumpfCommented:
BTW, "hand" is not in the standards, so you should use "pointer" instead:

onMouseOver="this.style.cursor='pointer';"
0
 
PreeceCommented:
Nice!  I'll use that in the future!
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
GwynforWebCommented:

<TH id="th1" style='cursor:pointer' >Company</TH>

no need for the mouseover
0
 
PreeceCommented:
even better yet!
0
 
COBOLdinosaurCommented:
Not for points just for best practices... do it in the stylesheet and you can support the olde IE browers as well:
<style type="text/CSS">
#th1 {cursor:hand;cursor:pointer;}
</style>

Cd&

0
 
DaydreamsCommented:
To support older browsers, the order is imortant:

th1 {cursor:pointer;cursor:hand;}    <<--pointer is first

http://www.quirksmode.org/css/cursor.html


Modern browsers will ignore the incorrect hand declaration, while versions of IE which don't know the proper use of pointer will use the hand declaration. Using "hand" will not validate though.
0
 
DaydreamsCommented:
One more reference:

http://www.echoecho.com/csscursors.htm

See the table on cursor prprties and scroll down to the values "hand", "pointer" and then "cross-browser" and mouseover "test" in your chosen browser.

0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
  • 2
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now