Download
Demo
- Overview
- Documents
User Rating: 3.6/5 ( 13 votes)
Your Rating:
Features
- Fully responsive. Scales with its container.
- Separate settings per breakpoint
- Uses CSS3 when available. Fully functional when not.
- Swipe enabled. Or disabled, if you prefer.
- Desktop mouse dragging
- Infinite looping.
- Fully accessible with arrow key navigation
- Add, remove, filter & unfilter slides
- Autoplay, dots, arrows, callbacks, etc...
1. INCLUDE CSS AND JS FILES
<link rel="stylesheet" type="text/css" href="slick/slick.css"/> <script type="text/javascript" src="http://code.jquery.com/jquery-1.11.0.min.js"></script> <script type="text/javascript" src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"></script> <script type="text/javascript" src="slick/slick.min.js"></script>
2. HTML
<div class="your-class"> <div>your content</div> <div>your content</div> <div>your content</div> </div>
3. JAVASCRIPT
$(document).ready(function(){ $('.your-class').slick({ setting-name: setting-value }); });
4. OPTIONS
Option | Type | Default | Description |
---|---|---|---|
accessibility | boolean | true | Enables tabbing and arrow key navigation |
autoplay | boolean | false | Enables Autoplay |
autoplaySpeed | int(ms) | 3000 | Autoplay Speed in milliseconds |
arrows | boolean | true | Prev/Next Arrows |
centerMode | boolean | false | Enables centered view with partial prev/next slides. Use with odd numbered slidesToShow counts. |
centerPadding | string | '50px' | Side padding when in center mode (px or %) |
cssEase | string | 'ease' | CSS3 Animation Easing |
customPaging | function | n/a | Custom paging templates. See source for use example. |
dots | boolean | false | Show dot indicators |
draggable | boolean | true | Enable mouse dragging |
fade | boolean | false | Enable fade |
easing | string | 'linear' | Add easing for jQuery animate. Use with easing libraries or default easing methods |
infinite | boolean | true | Infinite loop sliding |
lazyLoad | string | 'ondemand' | Set lazy loading technique. Accepts 'ondemand' or 'progressive'. |
onBeforeChange | function | null | Before slide callback |
onAfterChange | function | null | After slide callback |
onInit | function | null | Callback that fires after first initialization |
onReInit | function | null | Callback that fires after every re-initialization |
pauseOnHover | boolean | true | Pause Autoplay On Hover |
responsive | object | none | Object containing breakpoints and settings objects (see demo). Enables settings sets at given screen width. |
slide | element | 'div' | Element query to use as slide |
slidesToShow | int | 1 | # of slides to show |
slidesToScroll | int | 1 | # of slides to scroll |
speed | int(ms) | 300 | Slide/Fade animation speed |
swipe | boolean | true | Enable swiping |
touchMove | boolean | true | Enable slide motion with touch |
touchThreshold | int | 5 | Swipe distance threshold |
vertical | boolean | false | Vertical slide mode |
5. METHODS
Method | Arguments | Description |
---|---|---|
slickGoTo | int : slide number | Navigates to a slide by index |
slickNext | none | Navigates to the next slide |
slickPrev | none | Navigates to the previous slide |
slickPause | none | Pauses autoplay |
slickPlay | none | Starts autoplay |
slickAdd | html or DOM object, index, addBefore | Add a slide. If an index is provided, will add at that index, or before if addBefore is set. If no index is provided, add to the end or to the beginning if addBefore is set. Accepts HTML String || Object |
slickRemove | index, removeBefore | Remove slide by index. If removeBefore is set true, remove slide preceding index, or the first slide if no index is specified. If removeBefore is set to false, remove the slide following index, or the last slide if no index is set. |
slickFilter | Selector or Function | Filters slides using jQuery .filter() |
slickUnfilter | index | Removes applied filtering |
slickSetOption | option : string, value : depends on option, refresh : boolean | Sets an individual value live. Set refresh to true if it's a UI update. |
unslick | none | Deconstructs slick |