Search code examples
javascriptskrollr

skrollr.min.js is not initializing


var s = skrollr.init({    
    mobileDeceleration: 1,    
    edgeStrategy: 'set',    
    forceHeight: true,    
    smoothScrolling: true,    
    smoothScrollingDuration: 300,   
    easing: {    
        WTF: Math.random,
        inverted: function(p) {
            return 1-p;
        }
    }
});

When i try to init skrollr it just gives me this error: TypeError: Argument 1 of Window.getComputedStyle is not an object. What could it be?


Solution

  • I was having this same issue and putting the init inside $(document).ready resolved it for me.

    $(document).ready(function () {
        var s = skrollr.init();
    });