Search code examples
javascriptscrollresponsive-designparallax

skrollr.js: Turn off or destroy skrollr at a given window width


I'm using skrollr.js to animate a few things on a page. I'd like to only initialize skrollr when the window viewport width is larger than a particular size, and completely remove it or destroy it when I'm below that viewport width.

For instance, when the browser window width is greater than 600px, I want skrollr to be initialized, but when the browser's window width is less than 600px, I want to turn off or destroy skrollr.


Solution

  • The destroy instance method is what you are looking for. I've been working on it on last weeks and now it looks like Prinzhorn already merged my changes on the master branch.

    Hope to be helpful, cheers!