• Resolved ievari

    (@ievari)


    Hi,

    I have an issue when using anchor links in image captions. When I click on anchor link, it takes me to a specific part of the page, but when I close the lightbox, it instantly opens again. The issue does not occur when I close the lightbox without first clicking the anchor.

    The second thing, I’d like that the lightbox would close when clicked on anchor. I’ve tried to add this code to my main.js:
    $(‘.slb_template_tag_item_title a’).click(function() {
    $(‘#slb_viewer_wrap’).hide();
    });

    Maybe these two things are related & closing lightbox on anchor click would prevent from opening the lightbox again?

    I’m quite new to coding, so it seems that I’m really missing something.

    Many thanks in advance!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Archetyped

    (@archetyped)

    Hi, please provide a link to a page that exhibits the issue you are experiencing and I would be glad to take a closer look.

    Thread Starter ievari

    (@ievari)

    Thank you for the quick reply!

    Unfortunately, the website is still on localhost.

    I’ll try to describe the case in more detail if it may help.

    I am displaying images as a gallery from ACF repeater with data-slb-active. I wrapped each image in a href since image should open when clicked on a thumbnail. Captions included via ATTACHMENT DETAILS section with anchor link (e.g. [29]). Also it happens when I open same images from custom text links in posts.

    I’ve tried to deactivate other plugin that is using JS (https://www.ads-software.com/plugins/footnotes/) but the issue still occurred. What else could I add?

    If a given information is not helpful then I’d need to go live to provide you a link.

    • This reply was modified 4 years, 11 months ago by ievari.
    Plugin Author Archetyped

    (@archetyped)

    Thank you for the additional details. Clicking the anchor link adds an entry to the browser’s history, which conflicts with SLB’s lightbox history. I’ve added it to the list to optimize for a future update.

    Only valid template tags can perform actions such as closing the lightbox, so closing the lightbox via a link in the caption text is not supported.

    I’m closing this ticket as the issue has been logged, but I will post an update when the update containing the optimizations has been released.

    Thanks again.

    Thread Starter ievari

    (@ievari)

    Thank you very much, then please let me know when it’s fixed. For now I’ll disable this functionality.

    Best,
    Ieva

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Anchor link in caption opens image in lightbox’ is closed to new replies.