• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

double click for a href

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
no there is no way to make it a double click with just html.

Eric
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic