SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2005
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    ondblclick not working in IE

    <html><head><script>

    function f1()
    { alert("you single clicked on image")}

    function f2()
    { alert("you double clicked on image")}
    </script></head>

    <body>
    <img src="../logownba1.gif" onclick="f1()" ondblclick="f2()" >
    </body>

    </html>

  2. #2
    SitePoint Wizard gold trophysilver trophybronze trophy dc dalton's Avatar
    Join Date
    Nov 2004
    Location
    Right behind you, watching, always watching.
    Posts
    5,431
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The code works fine if you pull the onclick out. I think the problem is the onclick is firing (on the first click of course) so the ondblclick never has a chance to work ..... if you think about it it makes sense. You really cant get to the double click event IF the first of the two clicks always fires and throws your alert for it.

  3. #3
    SitePoint Enthusiast
    Join Date
    Feb 2005
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks a bunch... but thats not the fix..tried it
    did more searching... there is an order of operations for events ...
    and dblclick is last.
    I tried using the setTimeout function.. but still didn't get the desired results...
    must be something quirky..
    all advice welcome

  4. #4
    SitePoint Wizard gold trophysilver trophybronze trophy dc dalton's Avatar
    Join Date
    Nov 2004
    Location
    Right behind you, watching, always watching.
    Posts
    5,431
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hmm ......... works fine on my machine! What is it NOT doing on yours?


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
  •