...

View Full Version : fake href? how to get pointer finger?



yowyip
07-15-2003, 10:26 PM
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>

Danne
07-15-2003, 10:54 PM
<a onClick="changeimage(myimages[0],this.href)" style="cursor:hand;">1</a>

jkd
07-16-2003, 12:23 AM
No, not cursor: hand. That's not a valid value.

Use cursor: pointer;.

zuzupus
07-16-2003, 12:37 PM
<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

Vladdy
07-16-2003, 12:52 PM
I did this "finger" request awhile ago: http://www.codingforums.com/showthread.php?s=&postid=16598#post16598 :D :D :D
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(.....

requestcode
07-16-2003, 04:19 PM
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.

Vladdy
07-17-2003, 03:28 AM
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;
}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum