View Single Post
Old 03-23-2011, 09:32 PM  
mchacal
Confirmed User
 
mchacal's Avatar
 
Industry Role:
Join Date: Aug 2007
Location: Canada
Posts: 1,069
I'll try that

Quote:
Originally Posted by FlexxAeon View Post
right here:

Code:
function doMobile(){
    if(pageWidth() < 600){ 
        mobile = true;
    } else if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) {
        mobile = true;    
    } else if((navigator.userAgent.match(/android/i))) {
        mobile = true;    
    } else {
        mobile = false;
    }
it's only checking for ipod, iphone, and android. but opera is a third party browser so those terms probably wouldn't be in its user agent string. should be more like:

Code:
function doMobile(){
    if(pageWidth() < 600){ 
        mobile = true;
    } else if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/android/i)) || (navigator.userAgent.match(/mobi/i)) || (navigator.userAgent.match(/mobile/i)) || (navigator.userAgent.match(/blackberry/i))) {
        mobile = true;  
    } else {
        mobile = false;
    }
you can see where i added more user agent strings for it to check for. there's a shitload of them that you can be checking for. google around for "mobile user agents" and you'll see what i mean.
__________________
Tech & Gadgets at Great Prices - antonio(at)techtonystore.com | ICQ: 219116429 | Skype: tonio514
mchacal is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote