jqueryhtmlparallaxskrollr

Disable Skrollr for mobile device ( <767px )


Firstly would like to thanks @prinzhorn for such an amazing and powerful library. My question: I have implemented a Skrollr parallax background to the header of my website but I would like to disable this feature when viewed on a mobile device, particularly iphones, etc. eg. (max-width: 767px).I was wondering what would be the best way to do this? And if the destroy() function was able to do this or I should be using another technique? Also, if destroy() is the answer, how could I implement this correctly? Many thanks and examples or demo's greatly appreciated.


Solution

  • Skrollr has its own mobile check function

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