Accordion Menu Conflicts on every other scene load

  • I'm having a problem with some basic javascript I'm using for a custom accordion thumbnail method. When I put the script in the HTML file, it doesn't work because the krpano markup does not exist when the JS runs - so the classes don't exist yet. So I wrapped it in a function and called it from the XML as an event to execute onviewloaded - that works at first, but after selecting a scene, it stops working. After loading another scene, it starts working again. Every other scene makes it work again, it's strange. The event code is outside of any scene, and is set to keep=true. The layer containing the menu is also keep=true. I have no errors in the console.

    I've tried changing the event to onxmlcomplete, thinking that maybe it was just taking time for onloadcomplete to finish before I started trying to use the menu again - but onxmlcomplete doesn't work at all.

    I think it may have something to do with making it a function. Is there a way to put the JS in my HTML file but have it only run AFTER krpano loads? Like a krpano external call that only executes the script after the first load?

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!