๐Ÿ”” Alert..!! Get 2 Month Free Cloud Hosting With $200 Bonus From Digital Ocean ACTIVATE DEAL

touchFlow is a simple, touch-enabled jQuery scroller plugin which allows you to scroll/swipe/drag through a series of html contents in both directions.

scroller

Documentation

jquery.touchFlow

  • jQuery ๊ธฐ๋ฐ˜์˜ ์ˆ˜ํ‰or์ˆ˜์ง ํ„ฐ์น˜์Šคํฌ๋กค ๋‚ด๋น„๊ฒŒ์ด์…˜ ํ”Œ๋Ÿฌ๊ทธ์ธ
  • ๋งˆํฌ์—… ์š”์†Œ ์„ ํƒ์— ์ œ์•ฝ์ด ์—†์œผ๋ฉฐ ์ดˆ๋ณด์ž๋„ ์‰ฝ๊ฒŒ ์‚ฌ์šฉํ•˜๋„๋ก ์„ค๊ณ„
  • PC ๋ธŒ๋ผ์šฐ์ €์—์„œ ๋“œ๋ž˜๊ทธ๋กœ ์‚ฌ์šฉ๊ฐ€๋Šฅ (๊ธฐ๋ณธ ์˜ต์…˜์œผ๋กœ ํฌํ•จ v1.6.0)
  • CSS Selector์— ๋”ฐ๋ผ ๋‹ค์ค‘ ์ ์šฉ ๊ฐ€๋Šฅ
  • jQuery 1.7+, IE9+ ์ง€์›

Demo

http://dohoons.com/test/touchFlow

์„ค์น˜ ๋ฐฉ๋ฒ•

<script> ํƒœ๊ทธ ์ถ”๊ฐ€

<script src="jquery.touchFlow.js"></script>

NPM

$ npm i jquery.touchflow
var $ = require('jquery'); require('jquery.touchflow')($);

๊ธฐ๋ณธ ์‚ฌ์šฉ๋ฒ•

.nav_h_type { background: #ccc; position: relative; overflow: hidden; } .nav_h_type ul { float: left; display: block; font-size: 0; white-space: nowrap; position: relative; } .nav_h_type li { box-sizing: border-box; display: inline-block; width: 100px; height: 100px; line-height: 100px; vertical-align: top; text-align: center; font-size: 12px; background: #eee; border: 1px solid #ccc; } .nav_h_type li.on { background: #aaa; font-weight: bold; }
<div class="nav_h_type"> 	<ul> 		<li>contents 1</li> 		<li>contents 2</li> 		<li>contents 3</li> 		<li>contents 4</li> 		<li>contents 5</li> 		<li class="on">contents 6</li> 		<li>contents 7</li> 		<li>contents 8</li> 		<li>contents 9</li> 		<li>contents 10</li> 	</ul> </div>
$(".nav_h_list").touchFlow({ 	axis : "x", 	page : "li.on" });

Options

Option Name Defaut Description
useMouse true ๋งˆ์šฐ์Šค ๋“œ๋ž˜๊ทธ ์‚ฌ์šฉ
axis 'x' ๋“œ๋ž˜๊ทธ ๋ฐฉํ–ฅ ('x','y')
page 0 ์ดˆ๊ธฐ ํŽ˜์ด์ง€ (์•„์ดํ…œ ์ธ๋ฑ์Šค ์ˆซ์ž or CSS ์…€๋ ‰ํ„ฐ ๋ฌธ์ž์—ด)
speed 200 ์• ๋‹ˆ๋ฉ”์ด์…˜ ์†๋„ (ms)
snap false ์Šค๋ƒ… ๊ธฐ๋Šฅ ์‚ฌ์šฉ
scrollbar false ์Šคํฌ๋กค๋ฐ” ํ‘œ์‹œ
scrollbarAutoHide false ์Šคํฌ๋กค๋ฐ” ์ž๋™์ˆจ๊น€

Method

Name Description
go_page(index) index ํŽ˜์ด์ง€๋กœ ์ด๋™
posX() X ์œ„์น˜๊ฐ’
posX(value) X ์œ„์น˜๊ฐ’ ๋ณ€๊ฒฝ
posY() Y ์œ„์น˜๊ฐ’
posY(value) Y ์œ„์น˜๊ฐ’ ๋ณ€๊ฒฝ

CallBack

Name Description
initComplete ์ดˆ๊ธฐํ™” ์ฝœ๋ฐฑ
stopped ์Šคํฌ๋กค ์ •์ง€ ์ฝœ๋ฐฑ
resizeend ์œˆ๋„์šฐ ๋ฆฌ์‚ฌ์ด์ฆˆ ์ฝœ๋ฐฑ

You May Also Like