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.

Event listener HTML element generated after iframe load

Home Forums General Questions Event listener HTML element generated after iframe load

Tagged: 

Viewing 15 posts - 1 through 15 (of 25 total)
  • Author
    Posts
  • #49952
    victor.hamel
    Customer

    Hello,

    My interface loads the verge3d iframe when the page loads but I also generate some html elements after user interactions with the page and thus after all the verge3d elements and scripts have already loaded.

    This means some HTML event listener from the visual logic refer to items generated later on on the page via javascript. When the visual logic is loaded these items do not exist yet. Is there a way to re-assign the visual logic on elements with javascript or any other method after the iframe has already loaded ?

    Thank you for your help
    Victor

    #49972

    hi,

    yes, you can enable the event puzzle at any particular moment not just when the Verge3D scene is loaded. To do this, you can put this event puzzle inside a procedure puzzle, and then trigger it from your page via JavaScript
    https://www.soft8soft.com/docs/manual/en/puzzles/Procedures.html#calling_procedures_javascript

    Chief 3D Verger | LinkedIn | X

    #84393
    c4cc
    Customer

    Hi Yuri,

    What if I want to enable the event puzzle from the html page’s elements the verge3d iframe is in? In my case the html elements are already part of that html page, not generated by verge3d puzzles

    • This reply was modified 1 month, 4 weeks ago by c4cc.

    FPS trialproduct 20.9.25 https://postimg.cc/gallery/LMM5vkQ/af43346e

    #84468
    c4cc
    Customer

    Hi Yuri,

    speaking of enabling puzzles before Verge3d Scene is loaded, will the exec script puzzles run before the verge3d scene is loaded too?

    FPS trialproduct 20.9.25 https://postimg.cc/gallery/LMM5vkQ/af43346e

    #84574
    c4cc
    Customer

    hi,

    yes, you can enable the event puzzle at any particular moment not just when the Verge3D scene is loaded. To do this, you can put this event puzzle inside a procedure puzzle, and then trigger it from your page via JavaScript
    https://www.soft8soft.com/docs/manual/en/puzzles/Procedures.html#calling_procedures_javascript

    I tried, but it doesn’t work when html document’s element is clicked on while verge3d is initialising. Only after does it work. Any way to get Verge3d puzzles, like HTML events to run before app is initialized?

    • This reply was modified 1 month, 2 weeks ago by c4cc.

    FPS trialproduct 20.9.25 https://postimg.cc/gallery/LMM5vkQ/af43346e

    #84602

    Hi,
    Unfortunately the variables in the init tab are not shared with main tabs. If you still need to have them assigned, attach them as dictionary keys to the “window” object in the init tab and retrieve from that object in the main tabs. See the example:

    Init:


    Main:

    Soft8Soft Tech Chief
    X | FB | LinkedIn

    #84608
    c4cc
    Customer

    I tried, but using the event listener for HTML element puzzles before the app initialized did not update my variable values.

    FPS trialproduct 20.9.25 https://postimg.cc/gallery/LMM5vkQ/af43346e

    #84652
    c4cc
    Customer

    Do i need a “create empty dict” for the Javascript object Windows puzzle?

    FPS trialproduct 20.9.25 https://postimg.cc/gallery/LMM5vkQ/af43346e

    #84653
    Pandern
    Customer

    That “window” object is a nice tip. I have previously used ‘local storage’ to bring values from init tab to main tab.

    #84654
    c4cc
    Customer

    Just how do I change puzzle variables’ values using Event listener during app/scene loading?

    FPS trialproduct 20.9.25 https://postimg.cc/gallery/LMM5vkQ/af43346e

    #84655
    Pandern
    Customer

    Do i need a “create empty dict” for the Javascript object Windows puzzle?

    No, the window object exists already, you just add keys and values to it. Just add a ‘print to console’ in main tab to see if it works.

    #84656
    c4cc
    Customer

    I tried, but using the event listener for HTML element puzzles before the app initialized did not update my variable values.

    What did I do wrong here? Event listener won’t change puzzle variables’ values during loading

    FPS trialproduct 20.9.25 https://postimg.cc/gallery/LMM5vkQ/af43346e

    #84657
    Pandern
    Customer

    I tried, but using the event listener for HTML element puzzles before the app initialized did not update my variable values.

    What did I do wrong here? Event listener won’t change puzzle variables’ values during loading

    When/where is FullScreenstats triggered to run?

    #84658
    c4cc
    Customer

    whenever the main html document’s element for fullscreen is clicked.

    FPS trialproduct 20.9.25 https://postimg.cc/gallery/LMM5vkQ/af43346e

    #84659
    Pandern
    Customer

    whenever the main html document’s element for fullscreen is clicked.

    No, it won’t be triggered if it is inside a procedure, unless you call it from a javascript in the html document.

    Is the ID for the button just ‘fullscreen’? And is it in the parent HTML?

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