Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-15-2003, 10:26 PM   PM User | #1
yowyip
New to the CF scene

 
Join Date: Jul 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
yowyip is an unknown quantity at this point
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>
yowyip is offline   Reply With Quote
Old 07-15-2003, 10:54 PM   PM User | #2
Danne
Regular Coder

 
Join Date: Aug 2002
Location: São Paulo, Brazil
Posts: 367
Thanks: 0
Thanked 0 Times in 0 Posts
Danne is an unknown quantity at this point
<a onClick="changeimage(myimages[0],this.href)" style="cursor:hand;">1</a>
__________________
/Daniel
Danne is offline   Reply With Quote
Old 07-16-2003, 12:23 AM   PM User | #3
jkd
Senior Coder

 
jkd's Avatar
 
Join Date: May 2002
Location: metro DC
Posts: 3,163
Thanks: 1
Thanked 18 Times in 18 Posts
jkd will become famous soon enough
No, not cursor: hand. That's not a valid value.

Use cursor: pointer;.
__________________
jasonkarldavis.com
jkd is offline   Reply With Quote
Old 07-16-2003, 12:37 PM   PM User | #4
zuzupus
Regular Coder

 
Join Date: Jun 2003
Posts: 183
Thanks: 0
Thanked 0 Times in 0 Posts
zuzupus is an unknown quantity at this point
<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
zuzupus is offline   Reply With Quote
Old 07-16-2003, 12:52 PM   PM User | #5
Vladdy
Senior Coder

 
Join Date: Jun 2002
Location: Nashua, NH
Posts: 1,724
Thanks: 0
Thanked 0 Times in 0 Posts
Vladdy is an unknown quantity at this point
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"
Vladdy is offline   Reply With Quote
Old 07-16-2003, 04:19 PM   PM User | #6
requestcode
Regular Coder

 
Join Date: Jun 2002
Posts: 626
Thanks: 0
Thanked 0 Times in 0 Posts
requestcode is an unknown quantity at this point
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.
requestcode is offline   Reply With Quote
Old 07-17-2003, 03:28 AM   PM User | #7
Vladdy
Senior Coder

 
Join Date: Jun 2002
Location: Nashua, NH
Posts: 1,724
Thanks: 0
Thanked 0 Times in 0 Posts
Vladdy is an unknown quantity at this point
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"
Vladdy is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:50 AM.


Advertisement
Log in to turn off these ads.