Title: [Plugin: Infinite-Scroll] Javascript Callback stacking JS on previous posts
Last modified: August 20, 2016

---

# [Plugin: Infinite-Scroll] Javascript Callback stacking JS on previous posts

 *  [vengist](https://wordpress.org/support/users/vengist/)
 * (@vengist)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-infinite-scroll-javascript-callback-stacking-js-on-previous-posts/)
 * I’m using infinite-scroll along with other javascript methods. Everything works
   except for some expandable content issues.
 * I have the proper JS in the callback in the options menu, and it does load after
   more posts are fetched but multiple instances are placed on top of the previous
   pages’ posts and the expand does not work as it should anymore.
 * Is there a way to ensure the new script in the callback only affects those posts
   appended?
 * you can see the problem here:
 * [http://vengist.com/redux/collection](http://vengist.com/redux/collection)
 * Javascript in callback option field:
 * $(‘.expand’).toggler();
 * [http://wordpress.org/extend/plugins/infinite-scroll/](http://wordpress.org/extend/plugins/infinite-scroll/)

Viewing 1 replies (of 1 total)

 *  [benarobinson](https://wordpress.org/support/users/benarobinson/)
 * (@benarobinson)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/plugin-infinite-scroll-javascript-callback-stacking-js-on-previous-posts/#post-3000064)
 * Did you get this figured out? I have the same problem… It’s annoying because 
   I feel like it’s actually easy and I’ve almost figured it out and then I lose
   it. It seems like yours works now. I’m thinking it’s some matter of applying 
   and removing classes to designate which ones are used in a given instance… I 
   may have a new idea. Let me know if you solved your issue.

Viewing 1 replies (of 1 total)

The topic ‘[Plugin: Infinite-Scroll] Javascript Callback stacking JS on previous
posts’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/infinite-scroll.svg)
 * [Infinite-Scroll](https://wordpress.org/plugins/infinite-scroll/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/infinite-scroll/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/infinite-scroll/)
 * [Active Topics](https://wordpress.org/support/plugin/infinite-scroll/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/infinite-scroll/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/infinite-scroll/reviews/)

## Tags

 * [javascript](https://wordpress.org/support/topic-tag/javascript/)
 * [Multiple instances](https://wordpress.org/support/topic-tag/multiple-instances/)

 * 1 reply
 * 2 participants
 * Last reply from: [benarobinson](https://wordpress.org/support/users/benarobinson/)
 * Last activity: [12 years, 11 months ago](https://wordpress.org/support/topic/plugin-infinite-scroll-javascript-callback-stacking-js-on-previous-posts/#post-3000064)
 * Status: not resolved