使用lightgallery实现图片预览

图片预览,支持多图片滑动预览
 
git 地址
 
https://github.com/sachinchoolur/lightgallery.js
 
代码
 
# idnex.html
 
<script src=”js/lightGallery.js”></script>
 
# imagePreview.html
 
<div id=”lightgallery”>
 
  <a href=”img/img1.jpg”>
 
      <img src=”img/thumb1.jpg” />
 
  </a>
 
  <a href=”img/img2.jpg”>
 
      <img src=”img/thumb2.jpg” />
 
  </a>
 
  …
 
</div>
 
<script type=”text/javascript”>
 
    lightGallery(document.getElementById(’lightgallery’)); 
 
</script>
 
 
<script type=”text/javascript”>
 
  $(document)。ready(function() {
 
    $(”#lightGallery”)。lightGallery(); 
 
  });
 
</script>

如需转载,请注明文章出处和来源网址:http://www.divcss5.com/html/h64727.shtml

张贴在3