jquery.touchSlider
- jQuery κΈ°λ°μ νλ¦¬νΉ λ΄λΉκ²μ΄μ νλ¬κ·ΈμΈ
- λ§ν¬μ μμ μ νμ μ μ½μ΄ μμΌλ©° μ΄λ³΄μλ μ½κ² μ¬μ©νλλ‘ μ€κ³
- CSS Selectorμ λ°λΌ λ€μ€ μ μ© κ°λ₯
- PC λΈλΌμ°μ μμ λλκ·Έλ‘ μ¬μ©κ°λ₯ (κΈ°λ³Έ μ΅μ μΌλ‘ ν¬ν¨ v1.3.0)
- jQuery 1.7+, IE7+ μ§μ
Demo
μ€μΉ λ°©λ²
<script> νκ·Έλ‘ μΉνμ΄μ§μ μΆκ°
<script src="jquery.touchSlider.js"></script>
λλ NPMμΌλ‘ μ€μΉν΄μ μ¬μ©
$ npm i jquery.touchslider
var $ = require('jquery'); require('jquery.touchslider')($);
κΈ°λ³Έ μ¬μ©λ²
#touchSlider { background:#ccc; position:relative; overflow:hidden; } #touchSlider ul { position:absolute; top:0; left:0; overflow:hidden; } #touchSlider ul li { height:150px; background:#9C9; font-size:14px; color:#fff; }
<div id="touchSlider"> <ul> <li style="background:#9C9">content 1</li> <li style="background:#396">content 2</li> <li style="background:#39C">content 3</li> <li style="background:#33C">content 4</li> </ul> </div>
$("#touchSlider").touchSlider({ // ... Options page: 2 });
React.jsμμ μ¬μ©νκΈ°
Options
Option Name | Type | Default | Description |
---|---|---|---|
mode | String | 'swipe' | μ¬λΌμ΄λ λͺ¨λ ('swipe' or 'fade') |
page | Number | 1 | μ΄κΈ° νμ΄μ§ |
speed | Number | 150 | νμ΄μ§ λκΉ μ λλ©μ΄μ μλ (ms) |
view | Number | 1 | νμ΄μ§ λΉ μμ΄ν κ°μ |
gap | Number | 0 | μμ΄ν μ¬μ΄ κ°κ²© (pixel) |
range | Number | 0.15 | νμ΄μ§ λκΉ νμ λ²μ |
roll | Boolean | true | μ¬λΌμ΄λ λκΉ μν |
resize | Boolean | true | μλ 리μ¬μ΄μ¦ |
controls | Boolean | true | prev, next λ²νΌ μμ± |
paging | Boolean | true | page control μμ± |
sidePage | Boolean | false | μΈ‘λ©΄ νμ΄μ§ μ¬μ© |
transition | Boolean | true | CSS Transition μ¬μ© |
useMouse | Boolean | true | λ§μ°μ€ λλκ·Έ μ¬μ© μ¬λΆ |
btn_prev | Object | null | μ¬μ©μ prev λ²νΌ (jQuery Objec) |
btn_next | Object | null | μ¬μ©μ next λ²νΌ (jQuery Objec) |
autoplay | Object | { enable: false, pauseHover: true, addHoverTarget: '', interval: 3500 } | μλμμ§μ κ΄λ ¨ μ΅μ |
breakpoints | Object | null | λΈλ μ΄ν¬ ν¬μΈνΈ μ΅μ |
Method
Name | Description |
---|---|
go_page(index) | index νμ΄μ§λ‘ μ΄λ |
autoPlay() | μλ λκΉ μμ |
autoStop() | μλ λκΉ μ μ§ |
autoPauseToggle() | μλ λκΉ μμ/μ μ§ ν κΈ |
CallBack
Name | Description |
---|---|
initComplete | μ¬λΌμ΄λκ° μ΄κΈ°νλ ν μμ |
counter | μ¬λΌμ΄λλ₯Ό λκΈ΄ ν μμ |