how to get variables like "width.mobile"

  • Hi,
    I wonder what will be the syntax of getting values of variables like the above mentioned.

    Eg "trace(get(plugin[blabla].width.mobile));" will not work. How can I get these extended variables like x.mobile, y.tablet etc.?

    Thanks!

  • Hi,

    everything after the '.' dot in an attribute name is a kind of 'filter' for the xml parsing.
    It decides if that attribute will be parsed and set or skipped.

    Please see here for more:
    https://krpano.com/docu/xml/#devicechecksforattributes


    One additional note about:

    Code
    plugin[blabla].width="50" plugin[blabla].width.mobile="100"
    means width will be normally 50, or 100 if device.mobile is true

    Attributes are parsed one after the other - and some browsers (only IE so far I known) are passing the arguments in RANDOM order to the application (=to krpano). According to the xml-specs this is allowed.

    So it's not guaranteed that width.mobile="..." will be processed after width="...".

    Therefore 'non-overlapping' declration should be used.
    E.g. correct would be:
    width.normal="..."
    width.mobile="..."

    The filter '.normal' will cover desktop and tablet devices and '.mobile' will cover mobile devices. So all cases are clear and the order doesn't matter.

    Best regards,
    Klaus

Jetzt mitmachen!

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