[solved] Is it possible for html layer to contain ALL the functionality of a WEB page?

  • Hi, Is it possible to copy and paste the content of a web page and have it work in a html krpano layer? (See attachment)

    If yes, How to insert in index.html the js code? (See attachment and code below) ?

  • Fernando July 1, 2024 at 9:07 PM

    Changed the title of the thread from “Is it possible for an html layer to contain ALL the functionality of a WEB page?” to “Is it possible for html layer to contain ALL the functionality of a WEB page?”.
  • Hi indexofrefraction thankyou for your answer.

    This (using iframe) perfectly solves copying a web page (such as an accordion menu) but being an iframe makes it difficult to pass actions to the project. For example, how do I go from that iframe to a scene of the current project? That's why I was looking for the same functionality from a krpano html layer.

    Krpano layer type correctly interprets (runs) style.css but ignores script.js (see below code)

    Edited once, last by Fernando (July 2, 2024 at 2:39 AM).

  • Hi, indexofrefraction Thank you for your answser. For me It looks a little complicated.

    If you had to program an accordion menu like the one on this site: https://www.picosandshotel.com/pico-sands-hotel-360-view/

    How would you do it?

    Would you create your own plugin?

    How complicated would it be to do it?

    Maybe a solution could be to use CSS to style <details> and <summary> I don't like the idea that it is not compatible with older browsers, otherwise it would be fine.

  • srry, i don't really understand the problem.

    an accordion menu can be done both inside or outside krpano

    and both doesn't need a separate website with scripts (iframe).

    outside you could use bootstrap for example. (https://getbootstrap.com/docs/5.2/components/accordion/)

    inside you have the (old) krpano accordion plugin as a starting point.

    you don't have to use a krpano html layer if you can do a html/css/js accordion better,

    then it is better to just create it outside krpano.

    you can always get the krpano object and control krpano from the outside.

    Code
    var krpano = document.getElementById('krpanoSWFObject');
    krpano = krpano.get('global');
    krpano.actions.loadscene(...); // etc etc

    krpano.com - Documentation - Javascript Interface


    EDIT: example for a non-krpano accordion menu using CSS3:

    How to Create Accordion Menu in Pure CSS3 - Designmodo
    Topic: CSS3 Difficulty: Intermediate Estimated Completion Time: 30 mins In this tutorial we will learn how to create an accordion menu in pure CSS3. As we
    designmodo.com

    CSS3 Accordion Menu

    there are tons of options doing it with html/css/js,

    but doing it "the krpano way" is also possible, of course.

    whatever suits you better.

  • Fernando July 4, 2024 at 4:40 PM

    Changed the title of the thread from “Is it possible for html layer to contain ALL the functionality of a WEB page?” to “[solved] Is it possible for html layer to contain ALL the functionality of a WEB page?”.
  • Hi indexofrefraction Thank you for your advices. I used an html layer linked with bootstrap and it worked well with fullscreen using Mozilla Firefox.

    When you use bootstrap on a layer, should I worry about fullscreen or does it run normally? What is your experience?

    this is my normal html layer (no parent)

    Code
    <layer
    name="mylayerhtml"
    type="html"
    align="leftop"
    bgalpha="0.6"
    width="300"
    height="100%"
    htmloverflow="auto"
    html="get:data[data_ex].content"
    />


    Best regards,

    Fdo

Participate now!

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