I need to get the last product from a view port with a list of products in infinite scroll. How to get the last element (Last li tag) in the view port using jquery?
Asked
Active
Viewed 79 times
0
-
try $('li').last(); – Rohit Verma Jul 14 '18 at 12:27
-
@RohitVerma You've missed the essential _"from the view port"_ part. – Andreas Jul 14 '18 at 12:37
-
Yes i want the last element from the view port.... How to get it? – Pavithra Jul 14 '18 at 12:38
-
@Andreas I need the last element from the view port.... The link provided checks if an element is visible or not. Can anyone explain how to get the last element from view port? – Pavithra Jul 14 '18 at 12:48
-
Get all `
- ` elements, find the first non-visible, grab the previous `
- ` - done.
– Andreas Jul 14 '18 at 12:51 -
@Andreas. Thank you..!! Will try it. – Pavithra Jul 14 '18 at 12:52