Search code examples
jqueryhtmlcssparallax

jQuery Parallax Scroll disable on mobile/tablet


I am using a free template to build a static website (http://keenthemes.com/preview/megakit/) but I cannot seem to disable parllax scroll on mobile.

I have been trying to modify parallax.min.js file but cannot get it work on mobile devices. Images are not displayed on mobile at all.

Below is the code:

var Parallax=function(){"use strict";var a=function(){$(".js__parallax-window").parallax("50%",.1)};return{init:function(){a()}}}();$(document).ready(function(){if(window.innerWidth>760){Parallax.init()}});

Thanks for your help!


Solution

  • @media(max-width: 480px){
        .js__parallax-window {
            background-attachment: unset !important;
        }
    }
    

    Use this code in your css file, this will help for sure