Welcome to WebmasterWorld Guest from 54.211.62.139

Forum Moderators: incrediBILL

Message Too Old, No Replies

anchor double click event handling

     
3:02 am on Oct 24, 2009 (gmt 0)

Junior Member

5+ Year Member

joined:Apr 12, 2007
posts: 134
votes: 0


I have an anchor in my page which has href property set to a remote url. What i want is when someone double clicks the anchor page should not redirect to designated URL but one javascript function will carry out some operation.

I tried to set the href property "#" in function which is triggered after double click but it did not work the page still redirect to remote URL.

Can this be done

3:47 pm on Oct 26, 2009 (gmt 0)

Junior Member

10+ Year Member

joined:June 3, 2004
posts:193
votes: 0


If you want both single and double click to work then wrap the contents using a different element like span, label, li etc.

If you only need the double-click you can do something like,


<a href="#" onClick="return false;" onDblClick="doSomething();return false;">Link</a>
3:56 pm on Oct 26, 2009 (gmt 0)

Junior Member

5+ Year Member

joined:Apr 12, 2007
posts:134
votes: 0


hmm.thanks zipper
let me have a try
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members