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.
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.
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