-
Notifications
You must be signed in to change notification settings - Fork 1.7k
How to detect when we reach the last slide? #1670
Comments
Hi, Here is an example of how to add one extra slide - https://codepen.io/fancyapps/pen/ggwmbb |
Thank you, works great! A little tune up: My website loads 60 images at a time. If the user scrolls down to the bottom of the page, it will load 60 more images. Is it possible that whenever the user reaches the last image on fancybox, it will scroll down the page (loading 60 more images) and insert them inside the group without leaving the fancybox window? So that he can continue navigating through the images on fancybox. EDIT: I'm trying to create a jQuery function like:
But it doesn't work... what am I doing wrong? |
This is how you can check if reached last item: afterShow: function(instance, current) {
if (current.index === instance.group.length - 1) {
alert('I am the last item of the gallery');
}
} and the rest is up to you :) |
Thank you! Can you please check my edit? Thanks =) EDIT: Nevermind, got it by putting inside the afterShow function :P |
Is it possible to detect when we reach the last slide of the group? In previous versions I'd do it like so:
But it's not working anymore. Or, and preferably, display a default image in the end of groups (like an image saying "Go back to load more content").
The text was updated successfully, but these errors were encountered: