Closed DEHBChris closed 8 months ago
The new DOM content you're creating when you switch levels doesn't have an event listener attached and thus does nothing. You can see this by using the inspector in your browser's developer tools.
The problem is either your use of replaceWith
or your use of clone
; I'm not familiar with jQuery, so I'm not sure which is the culprit. If you just hide and show the <div>
elements instead of replacing them, you won't have this issue. Alternatively, depending on what jQuery does, you might also be able to avoid it by setting an onclick
property on the elements instead of using addEventListener
.
Hi mpetroff,
thank you for your quick reply.
I replaced the replaceWith
function for changing the floorplans with a hide
and show
function using jquery and now the loading of the scenes is working flawlessly.
Thank you and best regards
Hi,
thanks for the great viewer! For a bigger tour i am trying to build a floorplan including clickable mappoints with multiple levels (7 floors in total) which is located on the right side of the screen. To achieve this i built a div as a container which includes the buttons for changing the levels and a div for each level which includes the mappoints. Using jquery the displayed level div gets replaced by clicking the desired level button.
For the mappoints i am using 'loadscene' to load the correct scene of the tour.
Unfortunately this only works at the start level which is displayed first after loading the tour. After changing the levels the buttons seem to become inactive and no scene is loaded.
Could the use of jquery be a reason for this?
Live demo at: https://www.colorfantasy-fanpage.de/color-magic/test.html
Creating the floorplan menu
Script for changing the scene on one mappoint
Thank you in advance!