Home » jQuery 外掛

[jQ]Tiny Scrollbar 1.43

範例 1
沒錯!只要 1,200 元就能獲得我們團隊完整的協助,讓效果能迅速的整合到您的網站,並保證瀏覽器的相容性。
立刻申請!



如果想自訂網頁中的各種區塊的捲軸的話,那麼建議可以試試 Tiny Scrollbar 這好用的套件!只要設定好區塊及樣式,要弄出個有個性的捲軸就不是問題。

套件名稱:Tiny Scrollbar
套件版本:1.43
作者網站:http://baijs.nl/tinyscrollbar/
套件網址:N/A
發佈日期:2011-02-24
檔案大小:4.32 KB
檔案下載:jquery.tinyscrollbar.js

參數說明:

檢視原始碼 JavaScript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
axis(選填)
描述: 顯示垂直或是水平捲軸;允許的值為:x 或 y
預設值: 'y'
 
wheel(選填)
描述: 當滾動滑數滾輪時的移動參考值
預設值: 40
 
scroll(選填)
描述: 是否啟用支援滑鼠滾輪控制捲軸
預設值: true
 
size(選填)
描述: 整個捲軸的寬度
預設值: 'auto'
 
sizethumb(選填)
描述: 捲軸上的控制項的寬度
預設值: 'auto'

方法說明:

檢視原始碼 JavaScript
1
2
// 幫指定的區塊加上自訂的捲軸
$(selector).tinyscrollbar(options);

使用範例:

檢視原始碼 JavaScript
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery.tinyscrollbar.js"></script>
<style type="text/css">
	#scrollbar1 { width: 520px; clear: both; margin: 20px 0 10px; }
	#scrollbar1 .viewport { width: 500px; height: 200px; overflow: hidden; position: relative; }
	#scrollbar1 .overview { list-style: none; position: absolute; left: 0; top: 0; }
	#scrollbar1 .thumb .end,
	#scrollbar1 .thumb { background-color: #003D5D; }
	#scrollbar1 .scrollbar { position: relative; float: right; width: 15px; }
	#scrollbar1 .track { background-color: #D8EEFD; height: 100%; width:13px; position: relative; padding: 0 1px; }
	#scrollbar1 .thumb { height: 20px; width: 13px; cursor: pointer; overflow: hidden; position: absolute; top: 0; }
	#scrollbar1 .thumb .end { overflow: hidden; height: 5px; width: 13px; }
	#scrollbar1 .disable{ display: none; }
 
	#scrollbar2 { width: 315px; clear: both; margin: 20px 0 10px; }
	#scrollbar2 .viewport { width: 300px; height: 300px; overflow: hidden; position: relative; }
	#scrollbar2 .overview { list-style: none; width: 1500px; padding: 0; margin: 0; position: absolute; left: 0; top: 0;  }
	#scrollbar2 .overview img{ float: left; }
	#scrollbar2 .scrollbar,
	#scrollbar2 .thumb .end,
	#scrollbar2 .thumb { background: transparent url(images/bg-scrollbar-x.png) no-repeat; }
	#scrollbar2 .scrollbar { position: relative; overflow: hidden;  margin: 0 0 5px; clear: both; height: 15px; }
	#scrollbar2 .track { background: transparent url(images/bg-scrollbar-x-end.png) no-repeat 100% 0; width: 100%; height:13px; position: relative; padding: 1px 0; }
	#scrollbar2 .thumb { background-position: 100% -15px; height: 13px; cursor: pointer; overflow: hidden; position: absolute; left: 0; top: 1px; }
	#scrollbar2 .thumb .end{ overflow: hidden; background-position: 0 -15px; height: 13px; width: 5px;}
	#scrollbar2 .disable { display: none; }
</style>
<script type="text/javascript">
	$(function(){
		// 加入自訂捲軸
		$('#scrollbar1').tinyscrollbar();
 
		// 加入自訂捲軸並設定成水平捲軸
		$('#scrollbar2').tinyscrollbar({
			axis: 'x'
		});
	});
</script>
 
<body>
	<div id="scrollbar1">
		<div class="scrollbar"><div class="track"><div class="thumb"><div class="end"></div></div></div></div>
		<div class="viewport">
			<div class="overview">
				<h3>Magnis dis parturient montes</h3>
				<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut vitae velit at velit pretium sodales. Maecenas egestas imperdiet mauris, vel elementum turpis iaculis eu. Duis egestas augue quis ante ornare eu tincidunt magna interdum. Vestibulum posuere risus non ipsum sollicitudin quis viverra ante feugiat. Pellentesque non faucibus lorem. Nunc tincidunt diam nec risus ornare quis porttitor enim pretium. Ut adipiscing tempor massa, a ullamcorper massa bibendum at. Suspendisse potenti. In vestibulum enim orci, nec consequat turpis. Suspendisse sit amet tellus a quam volutpat porta. Mauris ornare augue ut diam tincidunt elementum. Vivamus commodo dapibus est, a gravida lorem pharetra eu. Maecenas ultrices cursus tellus sed congue. Cras nec nulla erat.</p>
 
				<p>Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Pellentesque eget mauris libero. Nulla sit amet felis in sem posuere laoreet ut quis elit. Aenean mauris massa, pretium non bibendum eget, elementum sed nibh. Nulla ac felis et purus adipiscing rutrum. Pellentesque a bibendum sapien. Vivamus erat quam, gravida sed ultricies ac, scelerisque sed velit. Integer mollis urna sit amet ligula aliquam ac sodales arcu euismod. Fusce fermentum augue in nulla cursus non fermentum lorem semper. Quisque eu auctor lacus. Donec justo justo, mollis vel tempor vitae, consequat eget velit.</p>
 
				<p>Vivamus sed tellus quis orci dignissim scelerisque nec vitae est. Duis et elit ipsum. Aliquam pharetra auctor felis tempus tempor. Vivamus turpis dui, sollicitudin eget rhoncus in, luctus vel felis. Curabitur ultricies dictum justo at luctus. Nullam et quam et massa eleifend sollicitudin. Nulla mauris purus, sagittis id egestas eu, pellentesque et mi. Donec bibendum cursus nisi eget consequat. Nunc sit amet commodo metus. Integer consectetur lacus ac libero adipiscing ut tristique est viverra. Maecenas quam nibh, molestie nec pretium interdum, porta vitae magna. Maecenas at ligula eget neque imperdiet faucibus malesuada sed ipsum. Nulla auctor ligula sed nisl adipiscing vulputate. Curabitur ut ligula sed velit pharetra fringilla. Cras eu luctus est. Aliquam ac urna dui, eu rhoncus nibh. Nam id leo nisi, vel viverra nunc. Duis egestas pellentesque lectus, a placerat dolor egestas in. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec vitae ipsum non est iaculis suscipit.</p>
 
				<h3>Adipiscing risus </h3>
				<p>Quisque vel felis ligula. Cras viverra sapien auctor ante porta a tincidunt quam pulvinar. Nunc facilisis, enim id volutpat sodales, leo ipsum accumsan diam, eu adipiscing risus nisi eu quam. Ut in tortor vitae elit condimentum posuere vel et erat. Duis at fringilla dolor. Vivamus sem tellus, porttitor non imperdiet et, rutrum id nisl. Nunc semper facilisis porta. Curabitur ornare metus nec sapien molestie in mattis lorem ullamcorper. Ut congue, purus ac suscipit suscipit, magna diam sodales metus, tincidunt imperdiet diam odio non diam. Ut mollis lobortis vulputate. Nam tortor tortor, dictum sit amet porttitor sit amet, faucibus eu sem. Curabitur aliquam nisl sed est semper a fringilla velit porta. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Vestibulum in sapien id nulla volutpat sodales ac bibendum magna. Cras sollicitudin, massa at sodales sodales, lacus tortor vestibulum massa, eu consequat dui nulla et ipsum.</p>
 
				<p>Aliquam accumsan aliquam urna, id vulputate ante posuere eu. Nullam pretium convallis tincidunt. Duis vitae odio arcu, ut fringilla enim. Nam ante eros, vestibulum sit amet rhoncus et, vehicula quis tellus. Curabitur sed iaculis odio. Praesent vitae ligula id tortor ornare luctus. Integer placerat urna non ligula sollicitudin vestibulum. Nunc vestibulum auctor massa, at varius nibh scelerisque eget. Aliquam convallis, nunc non laoreet mollis, neque est mattis nisl, nec accumsan velit nunc ut arcu. Donec quis est mauris, eu auctor nulla. Fusce leo diam, tempus a varius sit amet, auctor ac metus. Nam turpis nulla, fermentum in rhoncus et, auctor id sem. Aliquam id libero eu neque elementum lobortis nec et odio.</p>                             
			</div>
		</div>
	</div>
 
	<div id="scrollbar2">
		<div class="viewport">
			<div class="overview">
				<img src="images/a.jpg">
				<img src="images/b.jpg">
				<img src="images/g.jpg">
				<img src="images/n.jpg">
				<img src="images/e.jpg">
			</div>
		</div>
		<div class="scrollbar"><div class="track"><div class="thumb"><div class="end"></div></div></div></div>
	</div>
</body>
範例 1

檔案描述
基本的範例檔案(免空) 開始下載
基本的範例檔案 會員限定

8 筆針對 [jQ]Tiny Scrollbar 1.43 的迴響

  1. 請問,原作者的DEMO,可以有mouse-wheel的功能,但男丁的範例好像滾輪會失效!我自己實際使用,也會無效,不知是什麼原因?

發表迴響