This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

problem in applying onclick and ondblclick for a same element  RSS feed

 
yuvaraj KumarAmudhan
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there anyway to apply the onclick and ondblclick events for the same button?

Thanks
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use, but the onclick event will always fire so you need to build logic into it to wait to see if the dblclick event fires. Use flags and setTimeout.

Eric
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!