vendredi 17 avril 2015

Tracking browser history pushState for scrollable div

I'd like to track the state (scroll position) of a scrollable div.


I currently have a webapp that contains a fixed header and footer where the content area (a div) is scrollable.


My initial implementation tracks the scrollTop for the class on that div with pushState (window.history.state).


However, I'm curious as to whether there's a better way:




  1. Making the browser use pushState to track a specific area, like my div instead of the body




  2. Can the browser's pushState track the state in multiple areas, like the body and the scroll positions/states in multiple scrollable divs/content areas?




Aucun commentaire:

Enregistrer un commentaire