2 responses to “Tablet-Only jQuery using Media Queries”

  1. Jason

    Just thinking out loud here…
    Why not check the orientation and touch properties of the browser? I can’t think of a reason that a non-mobile would have both.

    orient = typeof orientation != 'undefined' ? true : false;
    touchOS = ('ontouchstart' in document.documentElement) ? true : false;
    mobileOS = false;
    if(orient && touchOS) {
    	mobileOS = true;
    }
    if(mobileOS) {
           //do mobile stuff
    } else {
          //do boring stuff
    }
    

Leave a Reply

You must be logged in to post a comment.