1 Star 1 Fork 30

cknote / picfixed

forked from 惟忆代码 / picfixed 
Create your Gitee Account
Explore and code with more than 6 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Without author's permission, this code is only for learning and cannot be used for other purposes.
Clone or download
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

传统的瀑布流都是等宽不等高,在视觉上给人不整齐

传统的瀑布流

picfixed 是一个等高瀑布流,可以让图片或者div轻松实现等高瀑布流

等高瀑布流

使用方法:

例子1:
$('#box-img').fixedpic(300);//指定靠拢高度
<div id="box-img">
	<img src="img/1.jpg" alt="">
	<img src="img/img.webp" alt="">
	<img src="img/img (2).webp" alt="">
	<img src="img/img (3).webp" alt="">
	<img src="img/img (4).webp" alt="">
	<img src="img/img (5).webp" alt="">
	<img src="img/img (6).webp" alt="">
	<img src="img/img (7).webp" alt="">
	<img src="img/img (8).webp" alt="">
	<img src="img/img (9).webp" alt="">
	<img src="img/img (10).webp" alt="">
	<img src="img/img (11).webp" alt="">
	<img src="img/img (12).webp" alt="">
	<img src="img/img (13).webp" alt="">
	<img src="img/img (14).webp" alt="">
	<img src="img/img (15).webp" alt="">
	<img src="img/img (16).webp" alt="">
	<img src="img/img (16).webp" alt="">
</div>
<div style="clear: both;">
<div>例子2:</div>
<div>$('#box-img2').fixedpic(350,990);//指定靠拢高度,宽度</div>
<div id="box-img2">
	<img src="img/1.jpg" alt="">
	<img src="img/img.webp" alt="">
	<img src="img/img (2).webp" alt="">
	<img src="img/img (3).webp" alt="">
	<img src="img/img (4).webp" alt="">
	<img src="img/1.jpg" alt="">
	<img src="img/img (6).webp" alt="">
	<img src="img/img (7).webp" alt="">
	<img src="img/img (8).webp" alt="">
	<img src="img/1.jpg" alt="">
	<img src="img/img (10).webp" alt="">
	<img src="img/img (11).webp" alt="">
	<img src="img/img (12).webp" alt="">
	<img src="img/img (13).webp" alt="">
	<img src="img/img (14).webp" alt="">
	<img src="img/img (15).webp" alt="">
	<img src="img/1.jpg" alt="">
	<img src="img/img (16).webp" alt="">
</div>
<div style="clear: both;">
<div>例子3: 针对DIV</div>
<div>$('#box-div').fixedpic(350,990);</div>
<div id="box-div">
	<div style="width:124px;height:300px;background-color: #ccc;padding:3px;">1</div>
	<div style="width:235px;height:367px;background-color: #233">2</div>
	<div style="width:1110px;height:987px;background-color: #099">3</div>
	<div style="width:821px;height:334px;background-color:#309">4</div>
	<div style="width:314px;height:200px;background-color:#639">5<div>更多说明</div></div>
	<div style="width:327px;height:399px;background-color:#949">6</div>
	<div style="width:500px;height:800px;background-color:#179">7</div>
	<div style="width:600px;height:800px;background-color:#739">8</div>
	<div style="width:800px;height:600px;background-color:#236">9</div>
	<div style="width:480px;height:720px;background-color:#547">0</div>
	<div style="width:300px;height:300px;background-color:#362">11</div>
</div>
<div style="clear: both;">
<div>例子4: 设置边框</div>
<div>$('#box-div2').fixedpicSet({
    paddingTop:11,paddingLeft:11,paddingRight:0,paddingBottom:0,
    borderTop:1,borderLeft:1,borderRight:1,borderBottom:1,
    borderStyle:"dotted"
}).fixedpic();</div>
<div id="box-div2">
	<div style="width:124px;height:300px;background-color: #ccc;padding:3px;">1</div>
	<div style="width:235px;height:367px;background-color: #233">2</div>
	<div style="width:1110px;height:987px;background-color: #099">3</div>
	<div style="width:821px;height:334px;background-color:#309">4</div>
	<div style="width:314px;height:200px;background-color:#639">5<div>更多说明</div></div>
	<div style="width:327px;height:399px;background-color:#949">6</div>
	<div style="width:500px;height:800px;background-color:#179">7</div>
	<div style="width:600px;height:800px;background-color:#739">8</div>
	<div style="width:800px;height:600px;background-color:#236">9</div>
	<div style="width:480px;height:720px;background-color:#547">0</div>
	<div style="width:300px;height:300px;background-color:#362">11</div>
</div>
<script src="jquery-1.8.3.min.js"></script> <script src="fixedpic.js"></script> <script> $('#box-img').fixedpic(300); $('#box-img2').fixedpic(350,990); $('#box-div').fixedpic(350,990);

$('#box-div2').fixedpicSet({ paddingTop:11,paddingLeft:11,paddingRight:0,paddingBottom:0, borderTop:1,borderLeft:1,borderRight:1,borderBottom:1, borderStyle:"dotted" }).fixedpic(340,990); </script>

Comments ( 0 )

Sign in for post a comment

About

实现等高等宽瀑布流的jquery插件, 适合各类图片网站. keyword: 图片瀑布流 等高瀑布流 spread retract
Cancel

Releases

No release

Contributors

All

Activities

load more
can not load any more
1
https://gitee.com/cknote/picfixed.git
git@gitee.com:cknote/picfixed.git
cknote
picfixed
picfixed
master

Search