Skip to content

simon-thorpe/scrollpersist

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

scrollpersist

Persist page scrolling to last position when user returns back to a visited page. No dependencies are required to run.

Simply include:

<script src="scrollpersist.js" data-delay="1000"></script>

anywhere on your page and the user will resume from their last scroll position when they return to that page.

Try the online demo

Optional Addons

For smooth animated scrolling you can also include jQuery and jQuery.scrollTo on your page too:

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-scrollTo/2.1.2/jquery.scrollTo.min.js"></script>
<script src="scrollpersist.js" data-delay="1000"></script>

About

Persist page scrolling to last position when user returns back to a visited page.

Resources

License

Stars

Watchers

Forks

Packages

No packages published