Grow your CSS skills. Land your dream job.

Detect mobile and redirect

  • # December 4, 2012 at 4:19 pm

    lol @JohnMotylJr well said

    # December 21, 2012 at 12:36 pm

    MobRedirect – Mobile Detection and Redirection is one of the great script i ever found on internet…… below is script download link

    http://codecanyon.net/item/mobredirect-mobile-detection-and-redirection/3630502

    # January 28, 2013 at 10:37 am

    Hi! just wanted to thank this conversation as I have rad it thru and implemented all steps successfully (thanks to Johnnyb). Now my main website diverts to mobile pages when opened on a phone. However, it just occurred to me, that I have in my mobile home page an option to go back to Classic view. That will never be achieved, as Classic view automatically diverts back to mobile. Is there any script that implements re-direction once only?
    Thanks in advance !! Ella

    # March 28, 2013 at 7:31 am

    Hello,

    If you ever decide to use server-side mobile detection (phones or tablets), I’ll point you to http://mobiledetect.net (someone else pointed to this script above, but it was the old Google Code repository). It’s MIT licensed and updated weekly. I’m one of the maintainers. Just look at the examples, it’s simple.
    Since everyone asks for both both “detection” and “redirect” or ways to choose and remember the website layout, I’ll suggest using the example: https://github.com/serbanghita/Mobile-Detect/blob/devel/examples/example1.php , it’s a simple procedural example, also includes an example of footer links for the visitor to choose the type of layout.

    Hope this helps.

    # March 28, 2013 at 8:35 am

    > Say you want to hide a sidebar with 6 ads in it for the mobile version, if using media-queries then that sidebar and those ads are still loaded in the page, they are just hidden using display: none. If each of those ads is 10k then that’s 60k (+ the weight of the HTML) which isn’t needed.

    https://github.com/Podders/Jquery-Media-Comments

    # April 1, 2013 at 7:06 pm

    I’ve gotten a bit confused. I have a similar problem. I built a site for someone, pretablets and smart phones. I’d have to re-build the whole site to use css media queries, I’d have to build a new responsive site. I built a totally separate jQuery mobile site, not a variation on original theme. I need a way to redirect small screens to this site, all new html and css etc., when the user device is a smart phone. Can anyone please help. I use jQuery regularly and have a basic knowledge of php. Much thanks in advance.

    # April 16, 2013 at 4:09 am

    Hahaha @JohnMotylJr !
    I’m lazy to ;)

    # April 16, 2013 at 4:45 am

    # May 7, 2013 at 10:11 am

    @Johnnyb I have a question regarding the redirect: http://johndoesdesign.com/dev/j/redirect/

    How can I manage to redirect a mobile user if clicked on a link “go to desktop version” to be directed to a desktop version? Currently with your script the device still detects that the user is using mobile and redirects again to the mobile version, but loads it funnily.

    Would appreciate your assistance ;-)

    # May 15, 2013 at 1:48 pm
    # June 17, 2013 at 3:51 am

    Hei,
    I need some help.

    What if I would like the same web page to show diffent content depending computer or mobile device?

    # June 17, 2013 at 12:33 pm

    shouldn’t it be…

    if($(window).width() > 480){
    window.location = “mobile.yoursite.com”
    }

    with the less than simbol instead of greater

    # June 17, 2013 at 12:59 pm

    i see im wrong there. But the jquery way not seem to be working with my iphone 5 in my tests.

    # June 25, 2013 at 11:37 am

    Cleanest and easiest I have EVER found:

    # November 1, 2013 at 11:46 am

    @Johnnyb

    Your snip:

    if($(window).width() < 480){

    window.location = “mobile.yoursite.com”

    }

    worked like a charm. However, I changed 480 to 1024. I know I am throwing all the tablet users under the bus, however for the client’s site I am working on, its applicable.

    Thanks man!

Viewing 15 posts - 31 through 45 (of 45 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".