Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

double click for a href

 
samart mateo
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
helo, from what i know, a href is activated with one mouse click only. Is there any way that the a href is only activated with double click? I'm trying to prevent having to use the javascript as the link is quite complicated to explain here.

please help me. Thank you very very much
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no there is no way to make it a double click with just html.

Eric
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could use the onClick event to store the time the link was clicked and increase a "click counter" up to 2.
Comparing the link was clicked the first time, with the time the link was clicked a second time. Wouldn't that be possible ?
Not sure... And if you had to do this for all links, that sounds like a pain.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Satou kurinosuke:
You could use the onClick event to store the time the link was clicked and increase a "click counter" up to 2.
Comparing the link was clicked the first time, with the time the link was clicked a second time. Wouldn't that be possible ?
Not sure... And if you had to do this for all links, that sounds like a pain.


Samart said "no javascript"

Eric
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Samart said "no javascript"

Dooooooohhh !!

Sorry. So my answer is :

no there is no way to make it a double click with just html.

 
samart mateo
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Satou kurinosuke:
You could use the onClick event to store the time the link was clicked and increase a "click counter" up to 2.
Comparing the link was clicked the first time, with the time the link was clicked a second time. Wouldn't that be possible ?
Not sure... And if you had to do this for all links, that sounds like a pain.


emmmm, what i meant earlier was, i would like to prevent having to use the javascript's location.href...btw, click counter sounds quite interesting. could u give me some example?

TQ
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, I have not enough knowledge in Javascript to post some script.

The main idea is :
1. Declare an onClick event on your link
2. Use a variable for the click counter and set it to 0
3. Use a variable for the first click time
4. In the onClick event, increment the counter.
If it equals 1, get the current time and it
If it equals 2, get the current time and compare it with the previous click time.

Good luck
 
Manesh Kumar
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
w3.org states support of ondblclick with HTML 4.0
You can check this link for list of attributes
http://www.w3.org/TR/REC-html40/index/attributes.html

What can be suggested is,
in href and onclick attributes for anchor tag, point to some dummy function and then ondbclick you set document.location.href to your URL.

But do test cross browser compatibility
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic