I am developing a script to use in my PHP page in wordpress. My purpose is to create a title on any image shown in my photo gallery in lightbox, so I developed this:
$(".responsive1").bind("click", function() {
$(this).("<div class='imgTitle'><?php echo $title ?></div>").appendTo(".lb-nav");
});
But unfortunately it does not work. I have this feedback from the browser
>SyntaxError: missing name after . operator
Basically, I wish that every time that I click the image in the thumbnail with class `responsive1`, in the lightbox image that pop up, and a title will be added at the top.
To do this, I need to refer to that image using `this` after the function starts the imgtitle class is added and then appended to that lightbox image, once popped up.
Any ideas? I think my script is not in the correct syntax
thanks to everyone for help
My website page with the gallery, in case it can helps: https://www.paolobergomi.it/new-gallery/outdoor-portraits/
I am developing a script to use in my PHP page