WordPress.org

Ready to get started?Download WordPress

Forums

WP jQuery Lightbox
[resolved] Link one lightbox to another lightbox (2 posts)

  1. buymylife
    Member
    Posted 1 year ago #

    Greetings -- First off, great plugin. Many thanks for all your work.

    I'm running into the early stages of an issue I'd like to get your take on: I'm creating a fully custom gallery/thumbnail/lightbox combo with two galleries on the same page. The first gallery has a group of standard images; the second gallery has alternate versions of the same images that are in the first gallery. I'm attempting to link the lightboxed image in one gallery to its lightboxed equivalent in the other gallery.

    So far, the best option has seemed to be using captions -- that is, give each image a caption with a link of its partner in the other gallery. Something like <a href="http://localhost/img/image-alternate.jpg">view alternate</a>

    I thought this miiiight be an easy solution, but it's not working. The caption correctly displays the link, but clicking the link loads the alternate image in _self without a lightbox. I've tried using an event.preventDefault within your showImage function... and I can get it do some of what I want... but I can't seem to trigger the lightbox after the prevent. I know this is wrong, but here's a version of what I've tried (my js skills aren't quite good enough to figure out how to pass the caption link's rel attribute):

    $("#caption a").click(function(event){
    event.preventDefault();
    linkLocation = this.href;
    $("#lightbox").fadeOut(400, redirectPage);
    });
    function redirectPage() {
    window.location = linkLocation;
    }

    I fully realize this is outside the scope of the plugin, but I'm nevertheless wondering if you have any ideas. Many thanks in advance. Hope this finds you well --

    http://wordpress.org/extend/plugins/wp-jquery-lightbox/

  2. ulfben
    Member
    Plugin Author

    Posted 1 year ago #

    Sorry. The mod you need is very involved. There is no easy solution I'm afraid.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags