Reputation: 205
I'm currently using fancybox3 to zoom in on images.
I would like to be able to add a button/image below the image like this:
Is there an option in fancybox3 to do this or would I have to modify the source code. You can see it at canescollector.com.
Thanks!
Upvotes: 0
Views: 325
Reputation: 8769
It is possible using callbacks. The only problem is that caption can be on top of the image, one solution would be to push content up. Demo - https://codepen.io/anon/pen/mKbwJK
JS:
$('[data-fancybox]').fancybox({
idleTime: 0,
afterShow: function(instance, current) {
current.$content.append('<p class="fancybox-extra"><button>Click me</button></p>');
}
});
CSS:
.fancybox-extra {
position: absolute;
top: 100%;
width: 100%;
text-align: center;
padding: 10px;
}
/* Hide while zooming */
.fancybox-is-scaling .fancybox-extra {
display: none;
}
/* Push content up */
.fancybox-slide--image {
padding-bottom: 120px;
}
Upvotes: 1