Sorry other thread closed and I cannot reply.
@ Guenni007 . Script is not targeting the first_thumb but other image further down the gallery . If I change Content Element column count it will open a different thumb, but will be the same ones each time (not random).
Would you mind checking this please? Perhaps we could use the data-onclick=1 element or adjusting code to use First_thumb?
$('.link_to_lightbox a').addClass('no-scroll');
$(document).on('click', '.link_to_lightbox a', function(event) {
event.preventDefault();
var linkTarget = $(this).attr('href');
$(linkTarget).find("a.first_thumb").click();
});
please show me your page. If you can not make it public – you had to wait for a mod.
Actually I think I have resolved this now. It seems the column count affects the output code by adding a “first_thumb” class to more than 1 thumbnail, so ive adjusted code to target the first thumbnail only now.
Thank you for the quick response.
Hi,
Glad to know that this has been resolved! Thanks to @Guenni007. Let us know if you have more questions.
Have a nice day.
Best regards,
Ismael