You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 21, 2023. It is now read-only.
Hi! First of all I would like to share my love to this library! keep up the great work.
I was just implementing it in one of my projects and I bumped in an interesting case - When I use jQuery to call fluidbox() on all of the 'a' in the DOM.
I have 2 images:
Links to itself, so the a element links to the JPG file, and the child img element links to the same JPG file.
Links to a different location, so the a links to a website, and the child img element links to the JPG file.
What happens that image #2 breaks because the library doesn't check if both URLs are equal and only then triggers the fluidbox()
I have written a tiny workaround but maybe it will be possible to have an official solution for that?
$('a').each(function() {
const href = $(this).attr('href');
if (href) {
const imgSrc = $(this).find('img').attr('src');
if (imgSrc) {
if (href === imgSrc) {
$(this).fluidbox();
}
}
}
});