0

I am facing issues with skrollr.js , it creates some unwanted effects on mobile.

Looking for a way to disable skrollr.js for mobile or in particular devices with max.width 480px.

GibboK
  • 71,848
  • 143
  • 435
  • 658

1 Answers1

0

All you need is destroy() method.

UPDATED

Option 1:

var s = skrollr.init();
if (s.isMobile()) {
    s.destroy();
}

Skrollr has its own mobile check function.

option 2:

Use this code..

$(function () {
  // initialize skrollr if the window width is large enough
  if ($(window).width() > 767) {  //change the width according to your need
    skrollr.init(yourOptions);
  }

  // disable skrollr if the window is resized below 768px wide
  $(window).on('resize', function () {
    if ($(window).width() <= 767) {   //change the width according to your need
      skrollr.init().destroy(); // skrollr.init() returns the singleton created above
    }
  });
});

For more details please read here

Community
  • 1
  • 1
Leo the lion
  • 3,164
  • 2
  • 22
  • 40