lightgallery 使用

用途

  • 图片预览,支持多图片滑动预览

git 地址

代码

# 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>
posted @ 2021-06-07 14:36  shellon  阅读(591)  评论(0编辑  收藏  举报