简体   繁体   中英

on(“click”) only firing after second click

I'm using an anchor link to load more posts the issue is it's not firing in the first click (at first time ONLY) but to load more posts in the second time, it works with first click.

 jQuery(window).load(function() { jQuery('#load-more').on('click', function (){ if( !(count > total) && (count > 1) ){ //Function loadArticle(count, total, load_method, page_id, blog_style, blog_page_image_size, show_post_animation, item_animation); } count++; // Function noMoreArticles(count, total, load_method); return false; }); }); 
 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <a id="load-more" href="#">Load More</a> 

jQuery(window).load(function() { try with jQuery(document).readyfunction() {

may be some images are not loading so that is the issue

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM