-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
  • 46,329
  • 24
  • 102
  • 208
fidler2326
  • 61
  • 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,602
  • 1
  • 25
  • 45
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,614
  • 6
  • 43
  • 77