Title: Load with Jquery
Last modified: December 2, 2019

---

# Load with Jquery

 *  [mcolas](https://wordpress.org/support/users/mcolas/)
 * (@mcolas)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/load-with-jquery/)
 * Hello Guys,
 * Your plugin is very great but i didnt succeed to make a simple thing (its clearly
   my fault) can you help me ?
 * I have a loop with my 9 first articles, i have a bouton ajax more loader for 
   9 more.
 * But i have a jquery wich add a css class (detect device).
 * I need to charge all the content in my ajax loop and then jquery have to add 
   this class.
 * Is it on code ? or a parameter on shortcode ?
 * Thxs a lot
    -  This topic was modified 6 years, 6 months ago by [mcolas](https://wordpress.org/support/users/mcolas/).

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * (@dcooney)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/load-with-jquery/#post-12200766)
 * Hi [@mcolas](https://wordpress.org/support/users/mcolas/) Not 100% sure what 
   you want to do, but maybe you need to the almComplete callback to initiate your
   jQuery.
    [https://connekthq.com/plugins/ajax-load-more/docs/callback-functions/almcomplete/](https://connekthq.com/plugins/ajax-load-more/docs/callback-functions/almcomplete/)
 * Hope that helps.
 *  Thread Starter [mcolas](https://wordpress.org/support/users/mcolas/)
 * (@mcolas)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/load-with-jquery/#post-12200802)
 * My problem is that my jquery code doesnt work on the ajax loop
 *  Plugin Author [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * (@dcooney)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/load-with-jquery/#post-12200807)
 * Yea, whats the jQuery code?
    You likely need to initiate the code and the way
   to do that is in the callback function.
 *  Thread Starter [mcolas](https://wordpress.org/support/users/mcolas/)
 * (@mcolas)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/load-with-jquery/#post-12200822)
 * A simple addclass, sorry!
    This class active a slider if its desktop
 * <script type=”text/javascript”>
    jQuery(document).ready(function($) { var alterClass
   = function() { var ww = document.body.clientWidth; if (ww >= 980) { $(‘#one’).
   addClass(‘active’); } }; $(window).resize(function(){ alterClass(); }); alterClass();});
   </script>
 *  Plugin Author [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * (@dcooney)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/load-with-jquery/#post-12200876)
 * You’ll have to rewrite this so it can be called from the almComplete callback.
 * `document.ready()` only fires on initial page load not after Ajax requests.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Load with Jquery’ is closed to new replies.

 * ![](https://ps.w.org/ajax-load-more/assets/icon-256x256.png?rev=2944639)
 * [Ajax Load More – Infinite Scroll, Load More, & Lazy Load](https://wordpress.org/plugins/ajax-load-more/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ajax-load-more/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ajax-load-more/)
 * [Active Topics](https://wordpress.org/support/plugin/ajax-load-more/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ajax-load-more/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ajax-load-more/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * Last activity: [6 years, 6 months ago](https://wordpress.org/support/topic/load-with-jquery/#post-12200876)
 * Status: not resolved