title: Best way to stop specific JavaScript function on mobile devices
body: <p>For my current project, I am using parallax scrolling on the website, and am currently developing the mobile/tablet versions of the site. </p>
  
  <p>At current, parallax scrolling doesn't work well on tablets and mobiles due to the difference in the scroll event, so I am wanting to disable the javascript calls in my scripts file when a mobile device is detected. At the moment I am doing this using </p>
  
  <p><code>
  if ( $(window).width() &gt; 960) {
  </code></p>
  
  <p>and then firing my parallax code. I am wondering if there is a better way of doing this that will target devices rather than resolution, as I am aware that a lot of the screens on the market will exceed 960px in width.</p>
  
  <p>The current version of the site is available at <a href="http://beta.residencyradio.com" rel="noreferrer">http://beta.residencyradio.com</a> if you want to see how it works, but any help at all would be appreciated!</p>