User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 397,880 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,703 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 7067 | Replies: 5
Reply
Join Date: Jul 2005
Location: Downingtown
Posts: 56
Reputation: hinde is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 3
hinde hinde is offline Offline
Junior Poster in Training

tag that shows hand on mouseover

  #1  
Apr 22nd, 2006
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.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2004
Location: Lincoln Park, Michigan
Posts: 1,744
Reputation: Comatose is an unknown quantity at this point 
Rep Power: 7
Solved Threads: 107
Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Moderator

Re: tag that shows hand on mouseover

  #2  
Apr 22nd, 2006
<A HREF="#">Link Here</A>
?
Reply With Quote  
Join Date: Jul 2005
Location: Downingtown
Posts: 56
Reputation: hinde is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 3
hinde hinde is offline Offline
Junior Poster in Training

Re: tag that shows hand on mouseover

  #3  
Apr 23rd, 2006
Thanks for the reply, but I found something even better, and I am a little embarrassed that I forgot I could do this.

<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.
Reply With Quote  
Join Date: Apr 2006
Location: Porterville, CA
Posts: 8
Reputation: iammatt is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
iammatt's Avatar
iammatt iammatt is offline Offline
Newbie Poster

Re: tag that shows hand on mouseover

  #4  
Apr 26th, 2006
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.

<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"
<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!
Reply With Quote  
Join Date: Dec 2004
Posts: 1,590
Reputation: tgreer is an unknown quantity at this point 
Rep Power: 7
Solved Threads: 34
Colleague
tgreer tgreer is offline Offline
Made Her Cry

Re: tag that shows hand on mouseover

  #5  
Apr 26th, 2006
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.
Reply With Quote  
Join Date: Feb 2006
Posts: 49
Reputation: Esopo is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
Esopo Esopo is offline Offline
Light Poster

Re: tag that shows hand on mouseover

  #6  
Apr 28th, 2006
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.
Site admin at NetBulge.com, a place set out to improve the web 1 good article at a time :)
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb JavaScript / DHTML / AJAX Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 9:33 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC