Welcome to WebmasterWorld Guest from 54.144.68.27

Forum Moderators: incrediBILL

Message Too Old, No Replies

anchor double click event handling

     

abhishekkaushik

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

5+ Year Member



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

Zipper

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

10+ Year Member



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>

abhishekkaushik

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

5+ Year Member



hmm.thanks zipper
let me have a try
 

Featured Threads

Hot Threads This Week

Hot Threads This Month