Results 1 to 3 of 3

Thread: A mystery: Opera and ondblclick

  1. #1
    Join Date
    Oct 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default A mystery: Opera and ondblclick

    Greeting Wiseman of DynamicDrive,

    Regarding:

    <img ALT="Sitemap" src="images/sitemap.png" width="150" height="154" name="sitemap"
    onclick="sitemap.width=697; sitemap.height=716"
    ondblclick="sitemap.width=150; sitemap.height=154">


    It works in FF and IE, but not I Opera (version: 8.51) and I can’t figure out why!

    The onclick works fine in Opera, but not the ondblclick.

    I am very happy for any help.

    Thank you

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    More of a mystery is why it works in those other browsers. Every dblcklick is a click first and, if it is a click, it then is really only a click followed by a click (once the first half is used to execute the onclick code). Generally, it is not recommended to use click and dblclick on the same element, for this very reason. You could get rid of the dblclick and make the click a toggle perhaps:

    HTML Code:
    <img alt="Sitemap" src="images/this.png" width="150" height="154" onclick="if(this.width=='150'){this.width='697';this.height='716'}else{this.width='150';this.height='154'};">
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Oct 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Talking A mystery no more

    With such logic reasoning I guess there is no real mystery. You point makes perfect sense.

    The solution you provide with merely the “onclick” element is an even more eminent solution than making the ondblclick/onclick dilemma work.

    Thank you very much for an easily put answer and solution.

    Jon

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
  •