Welcome to TalkGraphics.com
Results 1 to 7 of 7

Hybrid View

  1. #1
    Join Date
    Jun 2009
    Posts
    23

    Default Re: Mobile website device detection code??

    Hi Drwyd,

    Yes, that was the first piece of code I tried, of course, deleting the comment out code. Don't understand how changing the screen size to test in Xara would do anything; doesn't it have to be tested with a mobile device to verify if working correctly?

    Thanks for responding, really appreciate.

    Pixelart

  2. #2
    Join Date
    Mar 2009
    Location
    England
    Posts
    2,044

    Default Re: Mobile website device detection code??

    yes ideally it's best to test on a mobile device. In the absence of one the code can be tested in WD/DP by setting the triggering size to larger than your screen. With me now ?

  3. #3
    Join Date
    Jun 2009
    Posts
    23

    Default Re: Mobile website device detection code??

    Think so...kind of....

    Hi again,

    A little confused, I changed width, as you instructed, as so:

    <!--redirect to mobile web code-->

    <script type="text/javascript">

    if (screen.width <=3000) {
    document.location = "http://resumeidentity.com/mobile";
    }

    </script>

    After doing this, opened the index.htm file for the classic site in a browser and it takes me to the mobile site in the browser. Great! When I put the dimension back to "less than 699" or: if (screen.width <=699) if reverts back to desktop site. I am feeling either easily confused or stupid. I'm not showing it working on my mobile phone at all.

    Thanks for your patience! Pixelart

  4. #4

    Default Re: Mobile website device detection code??

    Is javascript enabled on your phone?

    Android: ► http://timeread.hubpages.com/hub/How...-Android-phone

  5. #5
    Join Date
    Mar 2009
    Location
    England
    Posts
    2,044

    Default Re: Mobile website device detection code??

    After doing this, opened the index.htm file for the classic site in a browser and it takes me to the mobile site in the browser. Great! When I put the dimension back to "less than 699" or: if (screen.width <=699) if reverts back to desktop site
    Which gives us proof that the code works and a working example

    The next step is then to check that the code is executed properly on the mobile device and that JS is enabled on it. (see Sledger's link)

    If this does not work on the device in its default setup then it's probably a non-starter.

    http://resumeidentity.com/mobile seems to work OK

 

 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •