I'm using Ajax Pagination and Infinite Scroll plugin by Malinky inside the WordPress blog that I'm currently working on. Plugin is set to load more button paging type.
I need to set it so that after the load more button is clicked, the first new loaded post is scrolled to the top of the viewport.
Unfortunately, the plugin is not very well documented and I can't find a way to select the first loaded post in order to apply animation to it inside the callback.
I've tried adding class 'anchor' to the last post both inside and outside the callback with $('article').last().addClass('anchor');
and then doing $('html, body').animate
to the $('article.anchor:nth-last-of-type(2)')
inside the callback in order to scroll to the bottom of the second last .anchor element, which is the element after which the first new loaded post is positioned, but for some reason the animation seems to not work with any nth- pseudo class. It only works with last-of-type, which is useless to me.
Is there a way to make this work somehow?
Saturday, 19 March 2016
jquery - How to scroll to top of the first post loaded with Ajax Pagination and Infinite Scroll plugin by Malinky?
Subscribe to:
Post Comments (Atom)
c++ - Does curly brackets matter for empty constructor?
Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...
-
A fair amount of the second act of The Dark Knight Rises has a class warfare plotline. This is foreshadowed in the trailers with Selina Ky...
-
I want to create an options array from a string. How can i create an array as { width : 100, height : 200 } from a string ...
-
I'm trying to set the size of a CardView inside of a DialogFragment , but I get this error: java.lang.NullPointerException: Attempt t...
No comments:
Post a Comment