0 Replies Latest reply on Apr 2, 2015 7:59 AM by joses65913379

    device detection

    joses65913379

      Hi!

       

      I'm trying to accomplish the following:


      I have 3 symbols in my stage, which are mobile_symbol, desktop_symbol and tablet_symbol.

       

      Basically if user is visiting from:

       

      - mobile device = displays mobile_symbol only

      - tablet device = displays tablet_symbol only

      - desktop device = displays desktop_symbol only

       

      Im using:


      if((navigator.userAgent.match(/iPhone/i))) {

            sym.$("mobile_symbol").show();

            sym.$("tablet_symbol").hide();

            sym.$("desktop_symbol").hide();

        }

        if((navigator.userAgent.match(/iPad/i))) {

           sym.$("mobile_symbol").hide();

            sym.$("tablet_symbol").show();

            sym.$("desktop_symbol").hide();

        }

        if(!isDevice){

            sym.$("mobile_symbol").hide();

            sym.$("tablet_symbol").hide();

            sym.$("desktop_symbol").show();

        }

       

      but not working in my code.


      Any advice and suggestions will be greatly appreciated

      Thank you in advance!