Targeting devices directly from the HTML?

  • Hello there, everyone, I hope you can lend me a hand on this one!

    I have implemented media share buttons inside the HTML that contains the tour, they seem to work nicely (of course they go away when I go into fullscreen which is something I can live with) but I would only like them to appear on desktop devices, not tablet|mobiles. Currently they appear everywhere. A workaround I tried was to have a main HTML opening a "prexml.xml" file which basically just redirects and opens a new HTML like this:

    Code
    <krpano onstart="if(device.mobile,openurl('index_mobile.html',_self); , openurl('index_desktop.html',_self););"/>

    This seems to work but I think it's not a very good programming scheme and perhaps it can have security issues in some browsers. The point would be to have a way to target my <div> share buttons inside the main HTML and make them appear / disappear depending on the device at hand.

    Any suggestions? *confused*

Participate now!

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