Created
September 30, 2014 17:32
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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