944,004 Members | Top Members by Rank

Ad:
You are currently viewing page 1 of this multi-page discussion thread
Apr 22nd, 2006
0

tag that shows hand on mouseover

Expand Post »
I need a tag that doesn't go anywhere when I click on it but will show the little hand with index finger outstretched like I am hovering over the text teh tag applies to. I googled for a while, but could not find anything related to what I am looking for. I need this because I am writing a file that will execute a javascript function when I click on it, which will display some new information, so I want it to appear to the user that he/she is clicking on a link.
Similar Threads
Reputation Points: 10
Solved Threads: 4
Junior Poster in Training
hinde is offline Offline
60 posts
since Jul 2005
Apr 22nd, 2006
0

Re: tag that shows hand on mouseover

JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. <A HREF="#">Link Here</A>
?
Team Colleague
Reputation Points: 361
Solved Threads: 214
Taboo Programmer
Comatose is offline Offline
2,413 posts
since Dec 2004
Apr 23rd, 2006
0

Re: tag that shows hand on mouseover

Thanks for the reply, but I found something even better, and I am a little embarrassed that I forgot I could do this.

JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. <a href="javascript:display_spaces()">Get spaces</a>

Much simpler. Only thing is I usually hate these links cause I always click links with my middle mouse button to open a new tab in firefox lol.
Reputation Points: 10
Solved Threads: 4
Junior Poster in Training
hinde is offline Offline
60 posts
since Jul 2005
Apr 26th, 2006
0

Re: tag that shows hand on mouseover

Quote originally posted by hinde ...
Thanks for the reply, but I found something even better, and I am a little embarrassed that I forgot I could do this.

JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. <a href="javascript:display_spaces()">Get spaces</a>
Much simpler. Only thing is I usually hate these links cause I always click links with my middle mouse button to open a new tab in firefox lol.
Or even simpler and "W3C Correct"
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. <span style="cursor: hand;">Text with Hand Icon</span>

If you're feeling sassy you could even tie that span to a class and add that to the CSS file to keep your code cleaner and more efficent. Using an anchor when not needed is ghetto!
Reputation Points: 10
Solved Threads: 0
Newbie Poster
iammatt is offline Offline
8 posts
since Apr 2006
Apr 26th, 2006
0

Re: tag that shows hand on mouseover

The last suggestion is the best. An anchor tag with the href set to "#" will navigate to the TOP of the page when clicked, which isn't quite the same thing as "go nowhere".

Similarly, using an empty JavaScript is... well, silly, in my opinion.

So I second IAMMATT's suggestion: just style a normal element, such as span, to display the hand cursor.

However, here's my standard scold: When a user sees their cursor turn to a hand, they expect that clicking will DO SOMETHING, in particular, that they will navigate somewhere.

So, creating an element that gives the hand cursor but that does nothing, violates the User Model, which is very nearly always a bad, bad idea.

EDIT: I re-read your original post. You want a hyperlink that runs a Javascript when clicked, so the
<a href="javascript:myFunction();">Run your function</a> is the proper method for this.
Team Colleague
Reputation Points: 227
Solved Threads: 37
Made Her Cry
tgreer is offline Offline
1,697 posts
since Dec 2004
Apr 28th, 2006
0

Re: tag that shows hand on mouseover

Here is a whole thread on the matter with many alternatives:
http://www.expertsrt.com/phpBB2/view...d484e1acd201b5

I agree that using a dummy javascript call is best.
Reputation Points: 14
Solved Threads: 1
Junior Poster in Training
Esopo is offline Offline
50 posts
since Feb 2006
Jan 12th, 2010
0
Re: tag that shows hand on mouseover
BTW "cursor:hand" only works in IE. The correct W3C standard is actually "cursor:pointer," which will work across all major browsers.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
johnnycho is offline Offline
10 posts
since Jan 2010
Jan 12th, 2010
0
Re: tag that shows hand on mouseover
Click to Expand / Collapse  Quote originally posted by johnnycho ...
BTW "cursor:hand" only works in IE. The correct W3C standard is actually "cursor:pointer," which will work across all major browsers.
Welcome to the community Johnny but try not to revive 4 year old threads in the future.
Sponsor
Reputation Points: 520
Solved Threads: 268
Code Monkey
ShawnCplus is offline Offline
1,564 posts
since Apr 2005
Jan 12th, 2010
0
Re: tag that shows hand on mouseover
Actually, I think it's good that he corrected the answer. It's still a valid question and cursor:pointer is still valid CSS for anyone else who might have the same question in the future
Administrator
Staff Writer
Reputation Points: 1422
Solved Threads: 162
The Queen of DaniWeb
cscgal is offline Offline
13,645 posts
since Feb 2002
Jan 12th, 2010
0
Re: tag that shows hand on mouseover
Click to Expand / Collapse  Quote originally posted by cscgal ...
Actually, I think it's good that he corrected the answer. It's still a valid question and cursor:pointer is still valid CSS for anyone else who might have the same question in the future
My post was also almost an exact quote of the response to my first post as a little throwback (I think it was Narue who responded to me)
Sponsor
Reputation Points: 520
Solved Threads: 268
Code Monkey
ShawnCplus is offline Offline
1,564 posts
since Apr 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JavaScript / DHTML / AJAX Forum Timeline: Full screen
Next Thread in JavaScript / DHTML / AJAX Forum Timeline: command to draw circle in javascript





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC