Call loadscene from <data>?

  • I'm creating a custom menu with my own markup, and using HTML within a data element, I have external javascript so I need my markup to have the appropriate CSS classes. When I try and use loadscene() from an onclick event, the console is telling me loadscene is not defined. Is there a better way to link directly to a scene from HTML?

    I could do it by using layers instead, and in that case loadscene would work - but I need a way to add classes or IDs to the layer elements so I can target them. I tried following this thread, but I am not seeing that any IDs were added to the DIV when I inspect those elements. Layers also don't really "float" relative to each other (which breaks my nice collapsible menu), so I'd prefer figuring out what I need to do to load a scene from an onclick in HTML data.

    Anybody have any ideas?

  • Or like this:

    Code
    // initiate a variable that can be used to control the entire tour
    let krpano = document.getElementById("krpanoSWFObject").get("global");
    
    // call the scene load function
    krpano.actions.loadscene('scene_name', null, 'MERGE', 'BLEND(1)');

Participate now!

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