JS实现瀑布流布局

本文实例为大家分享了JS实现瀑布流布局展示的具体代码,供大家参考,具体内容如下

html部分

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>瀑布流布局</title>
  <script src="wallpoll.js"></script>
  <link rel="stylesheet" href="wallpoll.css" rel="external nofollow" >
</head>
<body>
  <div id="main">
    <div class="box">
      <div class="pic">
        <img src="wallpoll/0.jpg" alt="">
      </div>
    </div>
    <div class="box">
      <div class="pic">
        <img src="wallpoll/0.jpg" alt="">
      </div>
    </div>
    <div class="box">
      <div class="pic">
        <img src="wallpoll/1.jpg" alt="">
      </div>
    </div>
    <div class="box">
      <div class="pic">
        <img src="wallpoll/2.jpg" alt="">
      </div>
    </div>
    <div class="box">
      <div class="pic">
        <img src="wallpoll/3.jpg" alt="">
      </div>
    </div>
    <div class="box">
      <div class="pic">
        <img src="wallpoll/4.jpg" alt="">
      </div>
    </div>
    <div class="box">
      <div class="pic">
        <img src="wallpoll/5.jpg" alt="">
      </div>
    </div>
    <div class="box">
      <div class="pic">
        <img src="wallpoll/6.jpg" alt="">
      </div>
    </div>
    <div class="box">
      <div class="pic">
        <img src="wallpoll/7.jpg" alt="">
      </div>
    </div>

    <div class="box">
      <div class="pic">
        <img src="wallpoll/8.jpg" alt="">
      </div>
    </div>
    <div class="box">
      <div class="pic">
        <img src="wallpoll/9.jpg" alt="">
      </div>
    </div>
    <div class="box">
      <div class="pic">
        <img src="wallpoll/10.jpg" alt="">
      </div>
    </div>
    <div class="box">
      <div class="pic">
        <img src="wallpoll/11.jpg" alt="">
      </div>
    </div>
    <div class="box">
      <div class="pic">
        <img src="wallpoll/12.jpg" alt="">
      </div>
    </div>
    <div class="box">
      <div class="pic">
        <img src="wallpoll/13.jpg" alt="">
      </div>
    </div>
    <div class="box">
      <div class="pic">
        <img src="wallpoll/14.jpg" alt="">
      </div>
    </div>
    <div class="box">
      <div class="pic">
        <img src="wallpoll/15.jpg" alt="">
      </div>
    </div>
    <div class="box">
      <div class="pic">
        <img src="wallpoll/16.jpg" alt="">
      </div>
    </div>
    <div class="box">
      <div class="pic">
        <img src="wallpoll/17.jpg" alt="">
      </div>
    </div>
    <div class="box">
      <div class="pic">
        <img src="wallpoll/18.jpg" alt="">
      </div>
    </div>
    <div class="box">
      <div class="pic">
        <img src="wallpoll/19.jpg" alt="">
      </div>
    </div>
    <div class="box">
      <div class="pic">
        <img src="wallpoll/20.jpg" alt="">
      </div>
    </div>
    <div class="box">
      <div class="pic">
        <img src="wallpoll/21.jpg" alt="">
      </div>
    </div>
    <div class="box">
      <div class="pic">
        <img src="wallpoll/22.jpg" alt="">
      </div>
    </div>
    <div class="box">
      <div class="pic">
        <img src="wallpoll/23.jpg" alt="">
      </div>
    </div>
    <div class="box">
      <div class="pic">
        <img src="wallpoll/24.jpg" alt="">
      </div>
    </div>
  </div>
</body>
</html>

      

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/1224.html