-5

I have a parallax scrolling site that i do not want to work on iPad. So i want to remove the link to my parallax.js file when on iPad.

How would I disable parallax scrolling on detection of device ?

Any direction would be deeply appreciated.

Andrea Ligios
  • 47,982
  • 25
  • 109
  • 228
fidler2326
  • 81
  • 1
  • 3

2 Answers2

0

Use something like:

var is_ipad = navigator.userAgent.indexOf('iPad') > -1

Then dont attach the events that activate the parallax

DickieBoy
  • 4,691
  • 1
  • 26
  • 46
0

Here's a thread that should allow you to catch other mobile devices: What is the best way to detect a mobile device in jQuery?

Here's a snippet, but don't ignore the many other useful responses:

if( /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) ) {
 // some code..
}
Community
  • 1
  • 1
justacoder
  • 2,644
  • 6
  • 45
  • 78