Click to See Complete Forum and Search --> : cursor:hand


ruchir123
01-04-2009, 01:34 PM
Hello,

I have following div tag where I have a need to change the mouse pointer to a "hand" when it loads. However, this works perfectly fine on IE, but does not work at all on FF.

<div id="Div1" class="panel" style="cursor: hand; margin-right:0.5%; margin-bottom:0.5%;" onclick="javascript:window.open('img_1440.html', '','width=600px,height=400px');" >

Please help

Thanks,
Ruchir

mikem
01-04-2009, 02:17 PM
Hi, Try using style="cursor:pointer;" instead of style="cursor:hand;" Mike :)

Charles
01-04-2009, 02:23 PM
Or you could change that a little and keep things working for the vast number of us who do not use JavaScript:<a href="img_1440.html" id="Div1" class="panel" style="display:block; margin-right:0.5%; margin-bottom:0.5%;" onclick="window.open(this.href, '','width=600px,height=400px'); return false" >

drhowarddrfine
01-04-2009, 04:41 PM
And use standard properties since 'hand' is not in the standard.

mikem
01-04-2009, 11:34 PM
Hi Charles,
style is an HTML attribute, described in the HTML 4.01 specification (http://www.w3.org/TR/html401/present/styles.html#adef-style), and cursor:pointer; is a CSS rule, described in the CSS 2.1 specification (http://www.w3.org/TR/CSS21/ui.html#cursor-props).
There is no JavaScript in my suggestion.
Mike :)

Fang
01-05-2009, 12:45 AM
There is no JavaScript in my suggestion.
Your JavaScript is an accessibility problem: http://www.webaim.org/techniques/javascript/other.php#popups

mikem
01-05-2009, 01:26 AM
Hi Fang, I still reckon my suggestion isn't JavaScript - but you can eloborate if you insist...
Mike :)

Fang
01-05-2009, 01:33 AM
It's not about your suggestion, but accessibility problem of your coding.
If JavaScript is disabled your popup will not work. Using the code given by Charles or the link I gave will allow all users to access the link.
http://www.webaim.org/techniques/javascript/

mikem
01-05-2009, 02:03 AM
Hi again Fang, Cannot accessibility be simply provided via an HTML accesskey attribute, something like this... <a href="http://www.google.com" style="cursor:pointer" accesskey="g">Google</a>
<!--
For Windows...
IE8 beta2: Shift+Alt+g, then hit Return.
FF3.0: Shift+Alt+g.
Opera 9.62: Shift+Esc, then hit g.
Safari 3.1.1: Alt+g.
--> Mike :)

Fang
01-05-2009, 02:45 AM
Using the anchor means the cursor:pointer is the default; the style is not required here.

There are problems using the accesskey.
You use "g" here, but that brings up the browser history menu for me (Dutch for History: Geschiedenis).
Browser menu accesskeys override the documet values.
http://www.rnib.org.uk/wacblog/articles/too-much-accessibility/too-too-much-accessibility-accesskeys/
http://www.cs.tut.fi/~jkorpela/forms/accesskey.html

felgall
01-05-2009, 04:35 PM
You can make the page more accessible by getting rid of the accesskey attribute. It was realised soon after that attribute was introduced into HTML that it actually has the reverse effect to that for which it was intended and reduces rather than increases the accessibility of the page.