• Resolved avishayg28

    (@avishayg28)


    Hi,
    I just updated the plugin to version 1.5.3 on my local machine, and the plugin stopped working.
    The ‘scrollSpy:exit’ just doesn’t trigger on $(‘hr[data-powered-by=”alnp”]’).
    I think the reason that it is happening is because the element $(‘hr[data-powered-by=”alnp”]’) is dynamically created with
    $( content_container ).prepend( '<hr style="height:0px;margin:0px;padding:0px;border:none;" data-powered-by="alnp" data-initial-post="true" data-title="' + post_title + '" data-url="' + orig_curr_url + '"/>' );
    And that can cause issues when trying to attache event on that element, see: https://stackoverflow.com/questions/1359018/in-jquery-how-to-attach-events-to-dynamic-html-elements

    Because if I try to change the element to an element which is not dynamically created, the event does get triggered: $( '.test' ).on( 'scrollSpy:exit', function(){ alert('This works!') });

    • This topic was modified 5 years, 5 months ago by avishayg28.
    • This topic was modified 5 years, 5 months ago by avishayg28.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter avishayg28

    (@avishayg28)

    ok I figured it out, the reason it didn’t work is because I should set position: relative to hr[data-powered-by="alnp"], it worth adding it to the plugin as default.

    Thanks

    Plugin Author Sébastien Dumont

    (@sebd86)

    @avishayg28 I am glad you managed to figure it out. Unfortunately, because themes are different from one another adding additional inline CSS may not be advised. If you need to additional CSS I would recommend doing it in either in your child-theme or under the “Additional CSS” section in the customizer, or you can use the alnp-post-loaded trigger.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Auto load stop working on version 1.5.3’ is closed to new replies.