sradha sradha - 1 month ago 13
Javascript Question

Light box 5 is not working in ajax page load

I am doing scroll page load using ajax for a project ,but i unable to show image in light box while i am scrolling and images are loading in ajax page load .

I am using light box 5 .



<script src="js/jquery.lightbox-0.5.js"></script>
<link rel="stylesheet" type="text/css" href="css/jquery.lightbox-0.5.css" media="screen" />


How can i do it ,am i doing any thing wrong or it is not supported in ajax load .

Thank you

Answer

you should reinitialize the lightbox again in your ajax response after adding the images as

$('img').lightBox();
Comments