jquery - Lightbox not working after new images load -
initialize lightbox:
<script type="text/javascript" src="<?=site_template_path?>/js/slimbox2.js"></script>
i have static images on page:
<a class="itogdetimg" href="" rel="lightbox" title=""> <img width="83px" src="/img.png" border="0"/> </a>
and have link id="knav1"
on click load new images jquery script:
$("#knav1").click(function(){ $("#navldesc").load('/api.php?nvl=y&komplektn=Комплит2'); });
links type same above, lightbox them no longer works. think because of not have them on page. how can fix problem?
for slimbox2 should work:
$("#knav1").click(function(){ $("#navldesc").load('/api.php?nvl=y&komplektn=Комплит2',function() { $("#navldesc").find("[rel='lightbox']").slimbox(/*if have custom options place them here*/); }); });
as mention initial comment, problem slimbox2 not care images added ajax. need apply slimbox
newly added images yourself.
but far can see slimbox2 not updated long time, happen not compatible newer versions of jquery. recommend should think of alternative. have own ui framework can give recommandation library better. (these date: fancybox2 lightbox2)
Comments
Post a Comment