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

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

php - Get uncommon values from two or more arrays -

Adding duplicate array rows in Php -