Skip to content

Instantly share code, notes, and snippets.

@josesayago
Created September 30, 2014 17:32
Show Gist options
  • Save josesayago/76aae5d037c757a81c1b to your computer and use it in GitHub Desktop.
Save josesayago/76aae5d037c757a81c1b to your computer and use it in GitHub Desktop.
This is a quick fix for the AJAX pagination function in Network Latest Posts. After loading content, it scrolls view to the top of posts.
jQuery(".nlp-instance-'.$instance.' .nlposts-wrapper").fadeOut("slow",function(){
jQuery(".nlp-instance-'.$instance.' .nlposts-wrapper").load(link+" .nlp-instance-'.$instance.' .nlposts-wrapper > *").fadeIn(3000, function(){
var nlpOffset = jQuery( ".nlposts-container" ).offset().top;
jQuery("body, html").animate({
scrollTop: nlpOffset-100
}, 200);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment