JQuery lightGallery is a lightweight jQuery lightbox gallery for displaying image and video gallery
add the Following code to the <head> of your document.
<link type="text/css" rel="stylesheet" href="css/lightGallery.css" /> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script src="js/lightGallery.js"></script> // Do not include both lightGallery.js and lightGallery.min.js
Create ul and li elements and add the path of the image or video inside the data-src attributes which you wish to open within the lightGallery.
<ul id="lightGallery"> <li data-src="img/img1.jpg"> <img src="img/thumb1.jpg" /> </li> <li data-src="img/img2.jpg"> <img src="img/thumb2.jpg" /> </li> ... </ul>
<script type="text/javascript"> $(document).ready(function() { $("#lightGallery").lightGallery(); }); </script>
<script type="text/javascript"> $(document).ready(function() { $("#lightGallery").lightGallery({ mode:'slide', useCSS : true, easing: 'ease',//'cubic-bezier(0.25, 0, 0.25, 1)',// speed: 1000, loop: false, auto: false, pause: 4000, escKey:true, exThumbImage: false, thumbnail: true, caption:false, desc:false, controls:true, hideControlOnEnd:false, mobileSrc: false, mobileSrcMaxWidth :640, //touch swipeThreshold: 50, rel:false, dynamic:false, dynamicEl : [], //video vimeoColor : 'CCCCCC', videoAutoplay:true, videoMaxWidth:855, //callbacks onOpen: function() {}, onSlideBefore: function() {}, onSlideAfter: function() {}, onSlideNext: function() {}, onSlidePrev: function() {}, onBeforeClose: function(){}, onCloseAfter: function(){} ); }); </script>