www.webdeveloper.com
Results 1 to 11 of 11

Thread: cursor:hand

  1. #1
    Join Date
    Dec 2008
    Posts
    34

    cursor:hand

    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

  2. #2
    Join Date
    Dec 2008
    Location
    Didim, Turkey
    Posts
    105
    Hi, Try using
    HTML Code:
    style="cursor:pointer;"
    instead of
    HTML Code:
    style="cursor:hand;"
    Mike
    Last edited by mikem; 01-04-2009 at 02:29 PM.

  3. #3
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,270
    Or you could change that a little and keep things working for the vast number of us who do not use JavaScript:
    Code:
    <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" >
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

  4. #4
    Join Date
    May 2005
    Posts
    2,040

  5. #5
    Join Date
    Dec 2008
    Location
    Didim, Turkey
    Posts
    105
    Hi Charles,
    style is an HTML attribute, described in the HTML 4.01 specification, and
    HTML Code:
    cursor:pointer;
    is a CSS rule, described in the CSS 2.1 specification.
    There is no JavaScript in my suggestion.
    Mike

  6. #6
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    Quote Originally Posted by mikem View Post
    There is no JavaScript in my suggestion.
    Your JavaScript is an accessibility problem: http://www.webaim.org/techniques/jav...her.php#popups
    At least 98% of internet users' DNA is identical to that of chimpanzees

  7. #7
    Join Date
    Dec 2008
    Location
    Didim, Turkey
    Posts
    105
    Hi Fang, I still reckon my suggestion isn't JavaScript - but you can eloborate if you insist...
    Mike

  8. #8
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    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/
    At least 98% of internet users' DNA is identical to that of chimpanzees

  9. #9
    Join Date
    Dec 2008
    Location
    Didim, Turkey
    Posts
    105
    Hi again Fang, Cannot accessibility be simply provided via an HTML accesskey attribute, something like this...
    HTML Code:
    <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

  10. #10
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    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/artic...ty-accesskeys/
    http://www.cs.tut.fi/~jkorpela/forms/accesskey.html
    At least 98% of internet users' DNA is identical to that of chimpanzees

  11. #11
    Join Date
    Mar 2005
    Location
    Sydney, Australia
    Posts
    7,974
    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.
    Stephen

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles