How can i run lightbox jquery in one html page more time -
how run lightbox jquery in html page multiple time. ? can run 1 jquery multiple time in single html page ?
the code used is
<script type="text/javascript"> $(function() { $('#gallery a').lightbox(); }); </script> <div id="gallery"> <ul> <li> <a href="photos/ilpunto-cat1.jpg" target="_parent"> <img src="photos/ilpunto_cat1.jpg" class="left"/> </a> </li>
if want apply lightbox more images inside gallery
$(function() { $('#gallery1 a').lightbox(); $('#gallery2 ul li a').lightbox(); });
or
$(function() { $('#gallery1 a, #gallery2 ul li a').lightbox(); });
i recommend first piece of code. lot more flexible.
Comments
Post a Comment