Reply To: Open lightbox from included anchor

Your Account / Forums / Easy FancyBox Pro / Open lightbox from included anchor / Reply To: Open lightbox from included anchor

January 11, 2016 at 7:25 pm #5984

Hi Anatoliy, welcome on this forum 🙂

To answer your question shortly: Yes it is possible.

The longer answer: because the lightbox is triggered by a click, you’ll need to add some jQuery javascript that will trigger a click based on the # URL identifier. You can see an example on the demo/test site http://demo.status301.net/easy-fancybox-sandbox/pdf-embeds where you’ll notice these permalinks mentioned below each of the test cases. These are the kind of links you are looking for, I suppose?

Lower on that same page, you’ll see a script snippet that was placed on the site to trigger a click based on the # identifier. Of course, the identifier must match the ID given to the link you want to fire on page load.

So to be clear, you’ll need to (1) add that script snippet to the site and (2) give each media link that you want to have opened on page load a unique ID. Then, this ID should be appended with a # after the page URL and sent to your clients customers.

Hope that helps 🙂