samedi 29 novembre 2014

Triggering function on page update (infinite scrolling)


I'm currently working on a Chrome extension that modifies content on a user's Tumblr dashboard, which uses infinite scrolling. However whenever the use scrolls down, a function needs to run again.


Here's a basic run-down of how I've got it working right now:



  • User loads page

  • Extensions modifies elements on page

  • User scrolls down

  • Triggers infinite scrolling

  • Next page loads below current one

  • More content loads


After that final step, I need step 2 to trigger again and have the new content modified.


I've tried .binding elements such as the entire <body>, the container div around the elements, and to no avail.


How do I trigger a function so that it runs when the content of a page changes (specifically the Tumblr dashboard)?


jQuery is fine, by the way.





Aucun commentaire:

Enregistrer un commentaire