Quick References
      ADO
      ASP
      CSS2
      HTML
      JavaScript
      Jet SQL
      VBScript
      WML
      WMLScript
      WSH
      XHTML
      XML DOM
      XSLT

Features
      Knowledge Base
      Tutorials

Partners
     ZVON.ORG
     XML
     Planet Source Code
     VisualBuilder
     Web Design
     Your HTML Source
     XML/XSLT Forums
     ASPAlliance
     Scripts
     
     Programmers Heaven
     Tek-Tips Forums
     Developer Fusion
     Code Project



A100205: Using JavaScript, How Can I Change the Mouse Icon from Arrow to Finger to Simulate Hovering Over a Link?

In IE4+ you can use the "cursor" style of an HTML element to change the mouse pointer. Note that this solution will not work in Netscape browsers.

We use the onmouseover event attribute to detect when the mouse moves over an element, and we then change the cursor style as required. For example, to make the cursor change to a hand when the mouse moves over an applicable HTML element, set the onmouseover event of the element as follows:

onmouseover="this.style.cursor='hand'"

If you want to apply this trick to some standard text, wrap the text in a span element, and set the onmouseover event:

<span onmouseover="this.style.cursor= 'hand'">Poke Me!</span>

There are nine types of cursors to choose from:
TO SEE EACH TYPE, RUN THE CURSOR OVER THE NAME

1. auto
2. crosshair
3. default
4. hand
5. move
6. *-resize (where * is n, ne, nw, s, se, sw, e or w)
7. text
8. wait
9. help

In Internet Explorer the cursor style applies to all of these HTML elements:

a, address, applet, b, big, blockquote, body, caption, center, cite, code, col, colgroup, currentstyle, custom, dd, dfn, dir, div, dl, dt, em, embed, fieldset, form, h1-6, hr, html, i, iframe, img, input, kbd, label, legend, li, listing, marquee, menu, object, ol, p, plaintext, pre, runtimestyle, s, samp, small, span, strike, strong, style, sub, sup, table, tbody, td, textarea, tfoot, th, thead, tr, tt, u, ul, var, xmp

In Internet Explorer, the onmouseover event applies to the following tags:

a, address, applet, area, b, bdo, big, blockquote, body, button, caption, center, cite, code, custom, dd, dfn, dir, div, dl, document, dt, em, embed, fieldset, form, h1-6, hr, i, img, input, kbd, label, legend, li, listing, marquee, menu, nextid, nobr, ol, p, plaintext, pre, tr, ruby, s, samp, select, small, span, strike, strong, sub, sup, table, tbody, td, textarea, tfoot, th, thead, tr, tt, u, ul, var, xmp

The Guru

   


Copyright 1999-2005 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information
knoxville photographer
knoxville wedding photographer