lightcase icon indicating copy to clipboard operation
lightcase copied to clipboard

How can I switch from one lightcase popup to second?

Open jurkaner opened this issue 7 years ago • 2 comments

Hey! I like your plugin very much, thank you for your work! I´m trying to set a lightcase link to switch from one popup to a second one... [Lightcase Popup One] text text text [a data-rel="lightcase" href="#second"]Close this popup and open second popup[/a] [/...]

[Lightcase Popup second] text text text [/...]

When click on the link between a popup, nothing happens. I use Lightcase v2.1.0, but I try it with Lightcase v2.5 without success.

Can you help me out, please? Thanks!

jurkaner avatar Aug 10 '18 12:08 jurkaner

You will need to initialize lightcase after the popup content has loaded, because at the time when you first initialize lightcase, the links that are part of the popup content do not exist yet.

$('[data-rel^=lightcase]').lightcase(
  {
    onFinish: {
      initializeLinks: function () {
        $('[data-rel^=lightcase]').lightcase({ ... });
      }
    },
    ...
  }
);

cbopp-art avatar Aug 13 '18 02:08 cbopp-art

You will need to initialize lightcase after the popup content has loaded, because at the time when you first initialize lightcase, the links that are part of the popup content do not exist yet.

$('[data-rel^=lightcase]').lightcase(
  {
    onFinish: {
      initializeLinks: function () {
        $('[data-rel^=lightcase]').lightcase({ ... });
      }
    },
    ...
  }
);

I also have to say I love your plugin and just implementing on a website. I had the same issue as above; this solution works only when clicked first, if I return to the first slide, the link doesn't work anymore. Neither if I close and reopen the popup. Do you have any hints how to make this work repeatedly?

Thank you!

aburany avatar Jul 09 '19 19:07 aburany