文档

Mocha使用好帮手

pic-list(图片列表)

作者:sonichuang
版本:v.2
依赖:mocha.css

样式1-一行展示(水平滚动条)

一行展示所有图片 .mocha-pic-list-scroll


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<div class="mocha-pic-list mocha-pic-list-scroll">
<ul class="mocha-pic-list-ul">
<li class="mocha-pic-list-item">
<a href="#"><img width="100" src="http://dummyimage.com/400x400/222/fff.png&text=<img>" alt="" class="pic"></a>
</li>
<li class="mocha-pic-list-item">
<a href="#"><img width="100" src="http://dummyimage.com/400x400/222/fff.png&text=<img>" alt="" class="pic"></a>
</li>
<li class="mocha-pic-list-item">
<a href="#"><img width="100" src="http://dummyimage.com/400x400/222/fff.png&text=<img>" alt="" class="pic"></a>
</li>
<li class="mocha-pic-list-item">
<a href="#"><img width="100" src="http://dummyimage.com/400x400/222/fff.png&text=<img>" alt="" class="pic"></a>
</li>
<li class="mocha-pic-list-item">
<a href="#"><img width="100" src="http://dummyimage.com/400x400/222/fff.png&text=<img>" alt="" class="pic"></a>
</li>
<li class="mocha-pic-list-item">
<a href="#"><img width="100" src="http://dummyimage.com/400x400/222/fff.png&text=<img>" alt="" class="pic"></a>
</li>
</ul>
</div>


样式2-不带文字

一行一张图 .mocha-pic-list-scheme1


1
2
3
4
5
6
7
<div class="mocha-pic-list mocha-pic-list-scheme1">
<ul class="mocha-pic-list-ul">
<li class="mocha-pic-list-item">
<a href="#"><img width="100%" src="http://dummyimage.com/400x400/222/fff.png&text=<img>" alt="" class="pic"></a>
</li>
</ul>
</div>



一行二张图 .mocha-pic-list-scheme2

1
2
3
4
5
6
7
8
9
10
<div class="mocha-pic-list mocha-pic-list-scheme2">
<ul class="mocha-pic-list-ul">
<li class="mocha-pic-list-item">
<a href="#"><img width="100%" src="http://dummyimage.com/400x400/222/fff.png&text=<img>" alt="" class="pic"></a>
</li>
<li class="mocha-pic-list-item">
<a href="#"><img width="100%" src="http://dummyimage.com/400x400/222/fff.png&text=<img>" alt="" class="pic"></a>
</li>
</ul>
</div>



一行三张图 .mocha-pic-list-scheme3

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<div class="mocha-pic-list mocha-pic-list-scheme3">
<ul class="mocha-pic-list-ul">
<li class="mocha-pic-list-item">
<a href="#"><img width="100%" src="http://dummyimage.com/400x400/222/fff.png&text=<img>" alt="" class="pic"></a>
</li>
<li class="mocha-pic-list-item">
<a href="#"><img width="100%" src="http://dummyimage.com/400x400/222/fff.png&text=<img>" alt="" class="pic"></a>
</li>
<li class="mocha-pic-list-item">
<a href="#"><img width="100%" src="http://dummyimage.com/400x400/222/fff.png&text=<img>" alt="" class="pic"></a>
</li>
<li class="mocha-pic-list-item">
<a href="#"><img width="100%" src="http://dummyimage.com/400x400/222/fff.png&text=<img>" alt="" class="pic"></a>
</li>
<li class="mocha-pic-list-item">
<a href="#"><img width="100%" src="http://dummyimage.com/400x400/222/fff.png&text=<img>" alt="" class="pic"></a>
</li>
<li class="mocha-pic-list-item">
<a href="#"><img width="100%" src="http://dummyimage.com/400x400/222/fff.png&text=<img>" alt="" class="pic"></a>
</li>
</ul>
</div>



一行四张图 .mocha-pic-list-scheme4

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<div class="mocha-pic-list mocha-pic-list-scheme4">
<ul class="mocha-pic-list-ul">
<li class="mocha-pic-list-item">
<a href="#"><img width="100%" src="http://dummyimage.com/400x400/222/fff.png&text=<img>" alt="" class="pic"></a>
</li>
<li class="mocha-pic-list-item">
<a href="#"><img width="100%" src="http://dummyimage.com/400x400/222/fff.png&text=<img>" alt="" class="pic"></a>
</li>
<li class="mocha-pic-list-item">
<a href="#"><img width="100%" src="http://dummyimage.com/400x400/222/fff.png&text=<img>" alt="" class="pic"></a>
</li>
<li class="mocha-pic-list-item">
<a href="#"><img width="100%" src="http://dummyimage.com/400x400/222/fff.png&text=<img>" alt="" class="pic"></a>
</li>
<li class="mocha-pic-list-item">
<a href="#"><img width="100%" src="http://dummyimage.com/400x400/222/fff.png&text=<img>" alt="" class="pic"></a>
</li>
<li class="mocha-pic-list-item">
<a href="#"><img width="100%" src="http://dummyimage.com/400x400/222/fff.png&text=<img>" alt="" class="pic"></a>
</li>
</ul>
</div>


样式3-带文字

一行一张图 .mocha-pic-list-scheme1


1
2
3
4
5
6
7
8
9
10
<div class="mocha-pic-list mocha-pic-list-scheme1 mocha-pic-list-skin1">
<ul class="mocha-pic-list-ul">
<li class="mocha-pic-list-item">
<a href="#">
<img width="100%" src="http://dummyimage.com/400x400/222/fff.png&text=<img>" alt="" class="pic">
<span class="txt">小爱神-丘比特</span>
</a>
</li>
</ul>
</div>


一行二张图 .mocha-pic-list-scheme2


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<div class="mocha-pic-list mocha-pic-list-scheme2 mocha-pic-list-skin1">
<ul class="mocha-pic-list-ul">
<li class="mocha-pic-list-item">
<a href="#">
<img width="100%" src="http://dummyimage.com/400x400/222/fff.png&text=<img>" alt="" class="pic">
<span class="txt">小爱神-丘比特</span>
</a>
</li>
<li class="mocha-pic-list-item">
<a href="#">
<img width="100%" src="http://dummyimage.com/400x400/222/fff.png&text=<img>" alt="" class="pic">
<span class="txt">小爱神-丘比特</span>
</a>
</li>
</ul>
</div>


一行三张图 .mocha-pic-list-scheme3


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<div class="mocha-pic-list mocha-pic-list-scheme3 mocha-pic-list-skin1">
<ul class="mocha-pic-list-ul">
<li class="mocha-pic-list-item">
<a href="#">
<img width="100%" src="http://dummyimage.com/400x400/222/fff.png&text=<img>" alt="" class="pic">
<span class="txt">小爱神-丘比特</span>
</a>
</li>
<li class="mocha-pic-list-item">
<a href="#">
<img width="100%" src="http://dummyimage.com/400x400/222/fff.png&text=<img>" alt="" class="pic">
<span class="txt">小爱神-丘比特</span>
</a>
</li>
<li class="mocha-pic-list-item">
<a href="#">
<img width="100%" src="http://dummyimage.com/400x400/222/fff.png&text=<img>" alt="" class="pic">
<span class="txt">小爱神-丘比特</span>
</a>
</li>
<li class="mocha-pic-list-item">
<a href="#">
<img width="100%" src="http://dummyimage.com/400x400/222/fff.png&text=<img>" alt="" class="pic">
<span class="txt">小爱神-丘比特</span>
</a>
</li>
<li class="mocha-pic-list-item">
<a href="#">
<img width="100%" src="http://dummyimage.com/400x400/222/fff.png&text=<img>" alt="" class="pic">
<span class="txt">小爱神-丘比特</span>
</a>
</li>
<li class="mocha-pic-list-item">
<a href="#">
<img width="100%" src="http://dummyimage.com/400x400/222/fff.png&text=<img>" alt="" class="pic">
<span class="txt">小爱神-丘比特</span>
</a>
</li>
</ul>
</div>


一行四张图 .mocha-pic-list-scheme4


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<div class="mocha-pic-list mocha-pic-list-scheme4 mocha-pic-list-skin1">
<ul class="mocha-pic-list-ul">
<li class="mocha-pic-list-item">
<a href="#">
<img width="100%" src="http://dummyimage.com/400x400/222/fff.png&text=<img>" alt="" class="pic">
<span class="txt">小爱神-丘比特</span>
</a>
</li>
<li class="mocha-pic-list-item">
<a href="#">
<img width="100%" src="http://dummyimage.com/400x400/222/fff.png&text=<img>" alt="" class="pic">
<span class="txt">小爱神-丘比特</span>
</a>
</li>
<li class="mocha-pic-list-item">
<a href="#">
<img width="100%" src="http://dummyimage.com/400x400/222/fff.png&text=<img>" alt="" class="pic">
<span class="txt">小爱神-丘比特</span>
</a>
</li>
<li class="mocha-pic-list-item">
<a href="#">
<img width="100%" src="http://dummyimage.com/400x400/222/fff.png&text=<img>" alt="" class="pic">
<span class="txt">小爱神-丘比特</span>
</a>
</li>
<li class="mocha-pic-list-item">
<a href="#">
<img width="100%" src="http://dummyimage.com/400x400/222/fff.png&text=<img>" alt="" class="pic">
<span class="txt">小爱神-丘比特</span>
</a>
</li>
<li class="mocha-pic-list-item">
<a href="#">
<img width="100%" src="http://dummyimage.com/400x400/222/fff.png&text=<img>" alt="" class="pic">
<span class="txt">小爱神-丘比特</span>
</a>
</li>
</ul>
</div>

修改模块皮肤CSS

模块的默认皮肤类.mocha-pic-list-skin1,您可以在您项目的page.css里修改.mocha-pic-list-skin1皮肤类,或者新增.mocha-pic-list-skin2

1
2
/* skin */
.mocha-pic-list-skin1 .mocha-pic-list-item .txt{color: #333;}