• 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 1 month, 2 weeks ago by mcolas.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author dcooney

    (@dcooney)

    Hi @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/

    Hope that helps.

    My problem is that my jquery code doesnt work on the ajax loop

    Plugin Author dcooney

    (@dcooney)

    Yea, whats the jQuery code?
    You likely need to initiate the code and the way to do that is in the callback function.

    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 dcooney

    (@dcooney)

    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)
  • You must be logged in to reply to this topic.