浏览 53762 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2012-07-19
最后修改:2012-07-19
需要用到Jquery,jquery.masonry.min.js 演示地址:http://www.mn606.com 效果图片: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="description" content="美女图片 - WWW.MN606.COM" /> <title>Masonry 瀑布流效果 - 美女图片</title> <style type="text/css"> body{background:#eee;font-size:12px;font-family:"宋体";color:#333p;} body,html,p,ul,li,dl,dt,dd,ol,h1,h2,h3,h4,h5{margin:0;padding:0;} ul li{list-style:none;} a{text-decoration: none;background-color: none} a:hover{text-decoration: none;} #page{ width:960px; margin:0 auto; } #main{background:#FFF;height: 590px; float:left; width:960px;} .item{ border:1px solid #EEE;float: left;display: inline;padding: 10px;margin: 10px 0px 0 14px;position: relative;} .item img{border: none;} </style> </head> <!-- 《瀑布流效果》 作者:Swiing QQ:35263107 演示地址:www.mm606.com --> <body> <div id="page"> <div id="main"> <div class="item"> <a href="http://www.mn606.com/"> <img src="http://image.mn606.com/images/2012/07/18/200_200/2012071820573960309.jpg" /></a> </div> <div class="item"> <a href="http://www.mn606.com/"> <img src="http://image.mn606.com/images/2012/07/17/200_200/2012071701021504380.jpg" /></a> </div> <div class="item"> <a href="http://www.mn606.com/"> <img src="http://image.mn606.com/images/2012/07/11/200_200/2012071100572176412.jpg" /></a> </div> <div class="item"> <a href="http://www.mn606.com/"> <img src="http://image.mn606.com/images/2012/07/18/200_200/2012071820231163974.jpg" /></a> </div> <div class="item"> <a href="http://www.mn606.com/"> <img src="http://image.mn606.com/images/2012/07/17/200_200/2012071701004194456.jpg" /></a> </div> <div class="item"> <a href="http://www.mn606.com/"> <img src="http://image.mn606.com/images/2012/07/18/200_200/2012071820190205402.jpg" /></a> </div> <div class="item"> <a href="http://www.mn606.com/"> <img src="http://image.mn606.com/images/2012/07/11/200_200/2012071100572176412.jpg" /></a> </div> <div class="item"> <a href="http://www.mn606.com/"> <img src="http://image.mn606.com/images/2012/07/18/200_200/2012071820573960309.jpg" /></a> </div> <div class="item"> <a href="http://www.mn606.com/"> <img src="http://image.mn606.com/images/2012/07/18/200_200/2012071820501119382.jpg" /></a> </div> <div class="item"> <a href="http://www.mn606.com/"> <img src="http://image.mn606.com/images/2012/07/17/200_200/2012071701021504380.jpg" /></a> </div> <div class="item"> <a href="http://www.mn606.com/"> <img src="http://image.mn606.com/images/2012/07/18/200_200/2012071820231163974.jpg" /></a> </div> <div class="item"> <a href="http://www.mn606.com/"> <img src="http://image.mn606.com/images/2012/07/17/200_200/2012071701004194456.jpg" /></a> </div> <div class="item"> <a href="http://www.mn606.com/"> <img src="http://image.mn606.com/images/2012/07/18/200_200/2012071820501119382.jpg" /></a> </div> <div class="item"> <a href="http://www.mn606.com/"> <img src="http://image.mn606.com/images/2012/07/18/200_200/2012071820190205402.jpg" /></a> </div> <div class="item"> <a href="http://www.mn606.com/"> <img src="http://image.mn606.com/images/2012/07/11/200_200/2012071100572176412.jpg" /></a> </div> <div class="item"> <a href="http://www.mn606.com/"> <img src="http://image.mn606.com/images/2012/07/18/200_200/2012071820573960309.jpg" /></a> </div> <div class="item"> <a href="http://www.mn606.com/"> <img src="http://image.mn606.com/images/2012/07/17/200_200/2012071701021504380.jpg" /></a> </div> <div class="item"> <a href="http://www.mn606.com/"> <img src="http://image.mn606.com/images/2012/07/18/200_200/2012071820231163974.jpg" /></a> </div> <div class="item"> <a href="http://www.mn606.com/"> <img src="http://image.mn606.com/images/2012/07/17/200_200/2012071701004194456.jpg" /></a> </div> <div class="item"> <a href="http://www.mn606.com/"> <img src="http://image.mn606.com/images/2012/07/18/200_200/2012071820501119382.jpg" /></a> </div> <div class="item"> <a href="http://www.mn606.com/"> <img src="http://image.mn606.com/images/2012/07/18/200_200/2012071820190205402.jpg" /></a> </div> </div> </div> </body> <script src="js/jquery-1.7.1.min.js"></script> <script src="js/jquery.masonry.min.js"></script> <script> $(function(){ var $container = $('#main'); $container.imagesLoaded( function(){ $container.masonry({ itemSelector : '.item' }); }); }); </script> </html> 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |