I'm using the jquery cycle and it runs fine with the exception of a jquery event not working.
I basically cycle images with captions, I set the captions in the "alt" attribute.
On particular images I call out a modal, assign a class to the image and have a jquery produce a modal - that works fine.
I also add a link within the caption, i can see the link there but when I go to click the link, jquery does not get fired.
Here is an image with this caption and link.
<img class="openModal" src="images/video.jpg" alt="<div class='wrap'><h1 class='caption-title'>Video</h1><p class='caption-desc'>Aliquam lectus orc ac.<a class='button' class='openModal'>watch the video</a></p></div>"/>
the alt tag contains an anchor with the class to call out the modal.
<a class='button' class='openModal'>watch the video</a>
here is the jquery
$('.openModal').on('click', function (e) {
console.log('this is the click');
e.preventDefault();
});
The cycle runs fine.
I click on the image, opens the modal - perfect.
I click on this link within the caption, it doesn't do anything.
What am I missing here?
alt
attribute? It is meant for text only. What do you expect it to do? - tcovo