Tagged: Lightbox
-
AuthorPosts
-
July 21, 2021 at 2:57 pm #1311157
Hello.
I used the following solution for a previous post (https://kriesi.at/support/topic/lightbox-image-activation) to activate Enfold lightbox image.
<?php echo ‘<div class=”avia-image-container avia-align-center “><div class=”avia-image-container-inner”></div>
</div>’; ?>Everything is OK when the page is loaded.
The page i am working has NEXT & PREVIOUS buttons and onClick retrieves data from database and loads the data in specific divs.
This includes the change of href & src in the above code.After ajax,the lightbox is not working.
Can you suggest me a way to fix this issue?
Thank you in advance
July 22, 2021 at 9:51 am #1311401Hello again.
I found the solution.STEP 1: I added the code below inside
<span class=”image-overlay overlay-type-image” style=”left: 1.99219px; top: 0px; overflow: hidden; display: block; height: 100%; width: 98%; border-radius:5px;”><span class=”image-overlay-inside”></span></span>’Example:
echo ‘<div class=”avia-image-container avia-align-center “><div class=”avia-image-container-inner”><a class=”lightbox avia_image” ‘
. ‘ href=”myPhotoURL” target=”_blank”><img class=”avia_image ” title=”” ‘
. ‘ src=”myPhotoURL” ‘
. ‘ alt=”myALTtext” />’
. ‘ <span class=”image-overlay overlay-type-image” style=”left: 1.99219px; top: 0px; overflow: hidden; display: block; height: 100%; width: 98%; border-radius:5px;”><span class=”image-overlay-inside”></span></span>’
. ‘</div>’
.'</div>’;STEP 2:
After ajax code is finished, you must run this code to reload lightbox://activates the lightbox
if($.fn.avia_activate_lightbox){
$(‘body’).avia_activate_lightbox();
}July 23, 2021 at 2:53 am #1311671Hi,
Great, I’m glad that you found a solution, and thanks for sharing. Please let us know if you should need any further help on the topic or if we can close it.
Best regards,
RikardJuly 23, 2021 at 8:48 am #1311755Yes you can close this topic.
Thank you.July 25, 2021 at 7:02 am #1312160 -
AuthorPosts
- The topic ‘lightbox not working after ajax’ is closed to new replies.