Thread Starter
rlmuk
(@rlmuk)
is there anybody who can help?
Hi, please try adding this custom script:
jQuery(".start-gallery").click(function () {
jQuery("#ftg-11 .tile-inner").first().click();
});
- “.start-gallery” is a class you should add to the button that will launch the lightbox
- #ftg-11 is the ID of the gallery, replace 11 with the id of your gallery
Thread Starter
rlmuk
(@rlmuk)
Thanks for you script, but I do not understand how should I bond it on “Text” (not button). Moreover I have different “Texts” on one Website with different galleries.
For example on one site there are different products presented. ext to each product stays “click for more photos”
After the visitor click on it, saved gallery will opened in lightbox.
But there are always different ID
A more general script could be:
jQuery(".start-gallery").click(function (e) {
e.preventDefault();
var galleryId = jQuery(this).data("gallery");
jQuery("#ftg-" + galleryId + " .tile-inner").first().click();
});
it can work on any element on the page (buttons, texts, etc). For example:
<a href="#" data-gallery="1">Click for more photos</a>
replace “1” inside the attribute data-gallery with the ID of the gallery.
Thread Starter
rlmuk
(@rlmuk)
Sorry, I tried all options, but it doesnt work.
I mean I place the script maybe on wrong way.
The href=”…” is understandabel for me, I can integrate it everywhere and only what I need is to write the correct ID number.
But how and where should I nsert the script. I already tried it in CSS of the site, in HTML code and even created jQuery.js with upper code and saved it under wp-content/themes/my-theme/js
But it not works too.
What do I making wrong?
-
This reply was modified 5 years, 10 months ago by rlmuk.
Thread Starter
rlmuk
(@rlmuk)
is there are realy nobody who could explain how to insert all this codes ?