We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

HTML onevent puzzle – unexpected and random behavoir

Home Forums Puzzles HTML onevent puzzle – unexpected and random behavoir

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #38678
    ocularvr
    Customer

    I have an issue today with HTML Events in Puzzles. I have a system with 10 annotations – When I make the HTML event click for the element, all goes well up to 4 puzzles, its when I add a 4th that things go strange. Please look at the images.

    NotOK = When I connect the puzzles I cant catch the 4th X in my annotations.

    OK = When I disconnect the 4th one, the X is picked up and it closes as expected

    My issue is that 5-10 do not work even with this trick. I looked closely at this and it seems that connecting and disconnecting the puzzle is behind what going on. I am completely blind on this one, please help!

    Here is the annotation (5):

    <link href="https://fonts.googleapis.com/css2?family=Poppins&display=swap" rel="stylesheet"> <div style=" background-color: rgba(0, 0, 0, 0.6); width:100px; height:150px; border: 2px solid #a1c037; border-radius: 25px; font-family: 'Poppins', sans-serif; font-size: 12px; font-weight: thin; color: white; padding: 5px; text-align: center;"> <button id="xcloseybutton5"style="float:right; border-radius: 25px;"">&times;</button> <br><div style="border-radius: 25px; background-color: rgba(0, 0, 0, 1);"> <b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Step 5</b></div> Look at best practices in documentation</div>

    Attachments:
    You must be logged in to view attached files.
    #38681

    please double check annotations ids – may be you got conflicting ones

    Chief 3D Verger | LinkedIn | Twitter

    #38682
    ocularvr
    Customer

    All annotation ids are unique, they are:

    id=”xcloseybutton1″
    id=”xcloseybutton2″
    id=”xcloseybutton3″
    id=”xcloseybutton4″
    id=”xcloseybutton5″
    id=”xcloseybutton6″
    id=”xcloseybutton7″
    id=”xcloseybutton8″
    id=”xcloseybutton9″
    id=”xcloseybutton10″

    I triple checked :)

    In the worst case scenarios I could just think of some other way of serving the annotations although I really like the close on X idea

    #38684

    may be you could try this puzzle instead https://www.soft8soft.com/docs/manual/en/puzzles/Objects.html#remove_annotation

    Chief 3D Verger | LinkedIn | Twitter

    #38685
    ocularvr
    Customer

    The execution of display=block or display=none is working, the problem is that the “X” inside the annotation does not work after you reach the 5th one. 1-4 are all good. I make another button and press it, the annotation X shows/hides ok. Its just getting the X to work thats driving me nuts. I really appreciate the help.

    Attachments:
    You must be logged in to view attached files.
    #38687
    ocularvr
    Customer

    Solved!!!!

    So I just made the div self close, good to go:

    <button id="xcloseybutton5" 
    onclick="document.getElementById('annotation5').style.display = 'none';" ">&times;</button>

    And removed all of the unnecessary onclic puzzles.

    Now I do this for the rest.

    Thank you Yuri for the fast feedback.

    Attachments:
    You must be logged in to view attached files.
    #38691

    glad you worked it out! :good:

    Chief 3D Verger | LinkedIn | Twitter

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.