youtube / spfjs

A lightweight JS framework for fast navigation and page updates from YouTube
https://youtube.github.io/spfjs/
MIT License
2.23k stars 147 forks source link

Restore the scroll position on back navigation #435

Closed tahola closed 7 years ago

tahola commented 7 years ago

I love SPFjs and I use it for a year now but there is something I never was able to do is to restoring scroll position on back and forward navigation, it seem to work very well on Youtube.com but on my app (chrome dekstop or android) and on the documentation as well, it doesnt work at all.

This is my js now :

        $(document).on("spfprocess",` function(e){
    });

    $(document).on("spfrequest", function(e){
        NProgress.start(); // start progress bar
    });

    $(document).on("spfdone", function(e){
        NProgress.done(); // progress bar done
    });

    $(document).on("spfhistory", function(e){
        NProgress.start(); // start progress bar
    });

    spf.init();

Any help ? Thanks

tahola commented 7 years ago

My bad I was on the 2.1.1, I just updated and it work fine. Sorry for that.

nicksay commented 7 years ago

Great, glad to hear it's working!