layer[name].iframe how to use


  • layer[name].iframe how to use


    *confused* *confused* *confused*

  • Hi,

    what do you want to do?

    The add_iframe action code in your example is wrong (that's not valid JS code) and unnecessary.

    Just this would be enough:

    Code
    <layer name="layer_iframe"
           type="iframe"
           iframeurl="https://krpano.com/home/"
           align="center" width="800" height="600"
           keep="true"
           />

    Best regards,
    Klaus

  • onloaded="layer[name].iframe"
    I haven't figured out how this is used?
    what is his role

    When the iframe is ready the onloaded event will be called and the layer will contain a iframe variable that provides access to the iframe html-element.

    *confused*

  • iframe.style.left = 0;
    iframe.style.top = 0;
    iframe.style.right = 0;
    iframe.style.bottom = 0;
    iframe.style.width = "100%";
    iframe.style.height = "100%";
    iframe.style.border = 0;
    iframe.style.margin = "auto";

    control parameters like this

  • Hi,

    none of these parameters would need to be set... (and basic layout properties also shouldn't be changed)

    Anyway to access the iframe element:
    - call a Javascript function
    - and access the iframe object by 'caller.iframe':

    See also here about the 'caller' object:
    https://krpano.com/docu/xml/#action.js

    Btw - in your first post example you were trying to use 'layer[layer_iframe].iframe', but that syntax is 'krpano script' code and not Javascript code.

    Best regards,
    Klaus

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!