[Javascript] Anotherbeginner's question

David Dorward david at dorward.me.uk
Mon Jan 30 09:01:44 CST 2006


On Mon, Jan 30, 2006 at 09:39:57AM -0500, John Warner wrote:
> An issue has come up today and the regular JavaScript guy is out this
> week. I hope this basic question does offend. I have a menu that leads
> to different pages, but don't want to use normal <a> tags for the links.
> The reason is we need to make a decision about where we send the client
> based on his choice and what we know about him (his IP is part of the
> decision).

Why not link to a server side script and make the decision there? It
is rather more reliable.

> My question is, how on a onMouseOver event do I (IE 6 is the
> target - intranet)  change the mouse cursor to the little hand figure
> like occurs when you point at a normal <a> in IE and of course back
> onMouseOut?

Not with JavaScript. You write a style sheet that applies

   cursor: pointer;

to the element you are attaching the script to. If you need to support
legacy Internet Explorer then you can use:

   cursor: hand; /* Non-standard for IE 4/5 */
   cursor: pointer;

Of course this does have the disadvantage that if you do depend on
JavaScript for the effect then you are still inviting all the people
who don't have it enabled to click.

In this case, you can set the property using JavaScript. e.g.

   onmouseover="this.className = 'fakeLink';"

-- 
David Dorward                                      http://dorward.me.uk




More information about the Javascript mailing list