Search code examples
javascriptcssgoogle-chromeskrollr

:Skrollr not working on Chrome


I seem to be having a problem with Skrollr, or at least I think it's Skrollr that's causing the problem...

I'm using this code:

data-0="background-position:0px 0px;"
data-end="background-position:-3000px 0px;" 

which is related to Skrollr, and for some reason it's working on IE and Firefox, but not on Chrome unless I inspect element first, which I find very strange.

Has anyone experienced a similar problem and do you have any suggestions on how it might be fixed?


Solution

  • I'm guessing that you need to do a refresh since I notice it works if I resize the browser.

    Try this code:

    setTimeout(function () {
    skrollr.get().refresh();
    }, 0);
    

    You can change the timeout to 1000 if necessary to ensure everything loads.

    See similar issue on github