Wow, thanks, your alternative works super.
Only issue now is that the custom option which I had set up for the fancybox-slider don’t apply anymore to the slider which is opened upon clicking the images. I had set it up like this:
selector : '[data-fancybox="images"]',
thumbs : false,
hash : false,
loop : true,
keyboard : true,
toolbar : false,
animationEffect : false,
arrows : true,
Do you know by any chance how to simply set the options for the fancybox-slider globally for the entire site so they apply to all future sliders on the site?
EDIT: Found out that global options can be set for fancybox by calling the default settings and changing them for the entire instance, like this:
$.fancybox.defaults.loop = "true";