SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    Caveat surfer Buddy Bradley's Avatar
    Join Date
    May 2003
    Location
    Cambridge, UK
    Posts
    2,366
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Is there any way to have the dblclick event cancel the click event?

    I have a table of data, where I was planning to have a click on a column header re-order the table, and double-click remove the column, but obviously by double-clicking the click event fires twice and I end up with a table sorted by a hidden column.

    Can anyone suggest a way of allowing the double-click event to cancel the click event?

  2. #2
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Perhaps you could make the click event start a timeout for whatever function you want to call. If the timeout ID exists already, then clear it. This means that on double click the onclick will called but then be canceled before the timeout ends. I haven't tried it but I don't see why it shouldn't work.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •