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.

Click Annotation to Show/Display HTML element?

Home Forums Puzzles Click Annotation to Show/Display HTML element?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #70360
    jefferywright
    Participant

    Event of Click for annotation, ID# b_cpitSeal01 = set display style of page element ID# pDisplay to Block does not work.

    Shouldn’t it?

    This does not create errors in the console.

    The code works perfectly on the page itself.

                   function showPD() {
      var x = document.getElementById("pDisplay");
    x.style.display = "inline-block";
    }

    How do I get an annotation click event to show the hidden div on my page?

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

    Interactive Multimedia and Visual Design
    https://jefferywright.com/

    #70410

    Hi jefferywright,

    can it be that the event listeners are assigned to the annotations before they are created?

    Chief 3D Verger | LinkedIn | Twitter

    #70426
    jefferywright
    Participant

    That is true if I create the event listeners on the page, which explains why that doesn’t work.

    So using puzzles appears to be the solution. Why don’t the puzzles in my example do the trick? Shouldn’t that work?

    I now placed the functions inside the function that makes the annotations appear, so that means the event listener is applied only when the annotations exist, this still produces no success and no console error.

    • This reply was modified 8 months, 3 weeks ago by jefferywright.
    Attachments:
    You must be logged in to view attached files.

    Interactive Multimedia and Visual Design
    https://jefferywright.com/

    #70429
    jefferywright
    Participant

    Got it sorted, instead of visibility in my last example, I specified the display attribute, and this does cause the pdisplay div on my page to appear… hopefully anyone else trying to do something similar will find this post helpful, thanks.

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

    Interactive Multimedia and Visual Design
    https://jefferywright.com/

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