jQuyer lightbox wont open for posts loaded with ajax
-
Hello,
I have any image with a the category “instagram” opening in a jQuery lightbox. For some reason any post loaded with the plugin now wont open as a lightbox. In fact no jQuery is working on any posts loaded with the plugin. I striped my jQuery right down, tried different selectors and still no luck. I tried following this post — Link — But my click event was already using
on('click' function())
. Could it be something to do with the fact the elements aren’t in the DOM when the page was loaded? Heres a sample of my code below. Any ideas would be much appreciated!<article id="post-<?php the_ID(); ?>" class="journalPost journalPost--instagram"> <div class="popUp__button--open" target="<?php echo $instagramCounter; ?>"> <h2 class="journalPost__title"> <?php the_title(); ?> </h2> </div> </article>
$('.popUp__button--open').on('click', function(){ alert("post has been clicked"); });
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘jQuyer lightbox wont open for posts loaded with ajax’ is closed to new replies.