Switch „mobile“ vs. „normal"

  • Hallo,

    i am trying to make a switch between big and small display sizes for different navigation.
    I thought about using

    <include url="..." devices="mobile" /> vs <include url="..." devices=„normal" />
    But my Macbook 15“ doesn´t get recognized as „normal“ (Other points like toch, mouse, html5… are recognized correctly on my macbook)

    Does anyone have an idea why it doesn´t get recognized as „normal"

    What would be the best simple way to switch between big (800 pixel or more) and small screen sizes?

    Edited once, last by flow (February 9, 2017 at 3:41 PM).

  • Try „normal" -> "normal" https://krpano.com/docu/actions/#device.normal
    What you want to switch? GUI buttons, image sizes? If you like to load other xml when e.g. screenwidth lower than 800px you can do something like:

    Code
    <include url="small_gui.xml" if="stagewidth LT 800" />

    but be aware this can load other xml at the beggining but in case resolution / orientation¸change your stagewidth could become bigger => you need to consider dynamic change via onresize event

  • Hi,

    Does anyone have an idea why it doesn´t get recognized as „normal"

    Too old krpano version?
    The device.normal was first added in 1.19-pr2.
    Or wrong usage...
    Or browser caching of old files...

    What would be the best simple way to switch between big (800 pixel or more) and small screen sizes?

    There is no universal 'best way'!
    The best way is always individually ;-).

    The normal/mobile devices settings don't relate to the screen/pixel size. If you want something window-size depended, the onresize event would need to be used - e.g. here some custom sample code:

    Best regards,
    Klaus

Participate now!

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