title: Browser width for mobile
body: <p>I have a Nexus 5, and when I go to <a href="http://ryanve.com/lab/dimensions/" rel="nofollow">http://ryanve.com/lab/dimensions/</a>, it tells me that my width 360. I understand that there is a difference between my phone's resolution and the width of my browser.</p>
  
  <p>However, when I write a function to change at under 767:</p>
  
  <pre><code>function detectmob() {
      if($(window).width() &lt;= 767) {
          return true;
      }
  
      else {
          return false;
      }
  }
  
  if (detectmob()){
  
  }
  
  else {
  
  }
  </code></pre>
  
  <p>It doesn't work on my phone. If I resize my browser window width to be &lt;= 767 on my laptop, the function works correctly. When I view it on my Nexus 5, it doesn't.</p>
  
  <p>Could anyone help me write a function to target mobile devices using the browser width?</p>