Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Jul 2003
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    fake href? how to get pointer finger?

    Hi,
    I have a onClick link on my page, but am wondering if I can somehow get it to look like an href tag, i.e. the "pointed finger" onMouseover. It is just text not an image, so you cannot tell it is a link because it just has the cursor...
    thanks in advance,
    -j

    here is the short version of the tag, hope it's enough:
    <a onClick="changeimage(myimages[0],this.href)">1</a>

  • #2
    Regular Coder
    Join Date
    Aug 2002
    Location
    São Paulo, Brazil
    Posts
    367
    Thanks
    0
    Thanked 0 Times in 0 Posts
    <a onClick="changeimage(myimages[0],this.href)" style="cursor:hand;">1</a>
    /Daniel

  • #3
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    No, not cursor: hand. That's not a valid value.

    Use cursor: pointer;.

  • #4
    Regular Coder
    Join Date
    Jun 2003
    Posts
    183
    Thanks
    0
    Thanked 0 Times in 0 Posts
    <a href="javascript:show_page('test.luck');"><img src="../img/xxx.gif" width="16" height="16" border="0" alt="Click Here to Pick up"></a>

    try this one

  • #5
    Senior Coder
    Join Date
    Jun 2002
    Location
    Nashua, NH
    Posts
    1,724
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I did this "finger" request awhile ago: http://www.codingforums.com/showthre...6598#post16598
    Oh, and do NOT do what the last post suggested - href="javascript:... is not a way to envoke javascript.

    While pointer is the correct style value for cursor property, it is not supported in IE5.5-. A hack that takes care of that is putting both:
    cursor: hand;
    cursor: pointer;
    and in this order!!!

    However in your particular example, you would do the folowing:
    Make sure your changeimage function returns false and then add href attribute pointing to a page that you want to use when javascript is disabled (or just #, if none);

    <a href="noJSlink.html" onclick=" return changeimage(.....
    Vladdy | KL
    "Working web site is not the one that looks the same on common graphical browsers running on desktop computers, but the one that adequately delivers information regardless of device accessing it"

  • #6
    Regular Coder
    Join Date
    Jun 2002
    Posts
    626
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hey Vladdy why is href="java script:... not a way to invoke javascript? I do it all the time and this is the first time I have heard that it should not be used. Just wondering.

  • #7
    Senior Coder
    Join Date
    Jun 2002
    Location
    Nashua, NH
    Posts
    1,724
    Thanks
    0
    Thanked 0 Times in 0 Posts
    For one, it makes the link brocken in browsers which do not support JavaScript (or have it disabled). Correct way:
    <a href="linktonoscriptresource.html" onclick="dostuff(); return false;">

    or better yet ... return dostuff();
    where
    function dosftuff(e)
    {
    ...
    return false;
    }
    Vladdy | KL
    "Working web site is not the one that looks the same on common graphical browsers running on desktop computers, but the one that adequately delivers information regardless of device accessing it"


  •  

    Posting Permissions

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