Code Monkey home page Code Monkey logo

jquery.touchflow's Introduction

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 마우스 드래그 사용
useWheel 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 윈도우 리사이즈 콜백

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.