Slick Carousel
A slideshow component for cycling through elements—images or slides of text—like a carousel.
How it works #
Thedir has taken the advantage of Slick carousel and extended it with dozens of new options. The carousel is a slideshow for cycling through a series of content, built with CSS 3D transforms and a bit of JavaScript. It works with a series of images, text, or custom markup. It also includes support for previous/next controls and indicators.
Official documentation
For more detailed information and examples, see the official documentation: Slick Carousel .
How to use? #
Copy-paste the stylesheets <link>
into your
<head>
to load the CSS.
Copy-paste the following <script>
near the end of your pages under JS Implementing Plugins to enable it.
Examples #
Image slides only #
Text slides only #
With controls #
With pagination #
Autoplay #
Infinite #
Vertical #
Multiple items #
Responsive display #
Center mode #
Slider syncing #
Right-to-left (RTL) #
JavaScript behavior #
Options can be passed via data attributes or JavaScript. For data attributes,
append the option name to data-slick-options
.
Example: data-slick-options='{"slidesToShow":
1}'
Attributes | Default | Description |
---|---|---|
accessibility |
true |
Enables tabbing and arrow key navigation |
adaptiveHeight |
false |
Enables adaptive height for single slide horizontal carousels. |
autoplay |
false |
Enables Autoplay |
autoplaySpeed |
3000 |
Autoplay Speed in milliseconds |
arrows |
true |
Prev/Next Arrows |
asNavFor |
null |
Set the slider to be the navigation of other slider (Class or ID Name) |
appendArrows |
$(element) |
Change where the navigation arrows are attached (Selector, htmlString, Array, Element, jQuery object) |
appendDots |
$(element) |
Change where the navigation dots are attached (Selector, htmlString, Array, Element, jQuery object) |
prevArrow |
<button
type="button" class="slick-prev">Previous</button>
|
Allows you to select a node or customize the HTML for the "Previous" arrow.. |
nextArrow |
<button type="button"
class="slick-next">Next</button> |
Allows you to select a node or customize the HTML for the "Next" arrow. |
centerMode |
false |
Enables centered view with partial prev/next slides. Use with odd numbered slidesToShow counts. |
centerPadding |
'50px' |
Side padding when in center mode (px or %) |
cssEase |
'ease' |
CSS3 Animation Easing |
customPaging |
n/a |
Custom paging templates. See source for use example. |
dots |
false |
Show dot indicators |
dotsClass |
'slick-dots' |
Class for slide indicator dots container |
draggable |
true |
Enable mouse dragging |
fade |
false |
Enable fade |
focusOnSelect |
false |
Enable focus on selected element (click). |
easing |
'linear' |
Add easing for jQuery animate. Use with easing libraries or default easing methods |
edgeFriction |
0.15 |
Resistance when swiping edges of non-infinite carousels |
infinite |
true |
Infinite loop sliding |
initialSlide |
0 |
Slide to start on |
lazyLoad |
'ondemand' |
Set lazy loading technique. Accepts 'ondemand' or 'progressive' |
mobileFirst |
false |
Responsive settings use mobile first calculation |
pauseOnFocus |
true |
Pause Autoplay On Focus |
pauseOnHover |
true |
Pause Autoplay On Hover |
pauseOnDotsHover |
false |
Pause Autoplay when a dot is hovered |
respondTo |
'window' |
Width that responsive object responds to. Can be 'window', 'slider' or 'min' (the smaller of the two) |
responsive |
none |
Object containing breakpoints and settings objects (see demo). Enables settings sets at given screen width. Set settings to "unslick" instead of an object to disable slick at a given breakpoint. |
rows |
1 |
Setting this to more than 1 initializes grid mode. Use slidesPerRow to set how many slides should be in each row. |
slide |
'' |
Element query to use as slide |
slidesPerRow |
1 |
With grid mode intialized via the rows option, this sets how many slides are in each grid row. dver |
slidesPerRow |
1 |
With grid mode intialized via the rows option, this sets how many slides are in each grid row. dver |
slidesToShow |
1 |
# of slides to show |
slidesToScroll |
1 |
# of slides to scroll |
speed |
300 |
Slide/Fade animation speed |
swipe |
true |
Enable swiping |
swipeToSlide |
false |
Allow users to drag or swipe directly to a slide irrespective of slidesToScroll |
touchMove |
true |
Enable slide motion with touch |
touchThreshold |
5 |
To advance slides, the user must swipe a length of (1/touchThreshold) * the width of the slider |
useCSS |
true |
Enable/Disable CSS Transitions |
useTransform |
true |
Enable/Disable CSS Transforms |
variableWidth |
false |
Variable width slides |
vertical |
false |
Vertical slide mode |
verticalSwiping |
false |
Vertical swipe mode |
rtl |
false |
Change the slider's direction to become right-to-left |
waitForAnimate |
true |
Ignores requests to advance the slide while animating |
zIndex |
1000 |
Set the zIndex values for slides, useful for IE9 and lower |
For more event and method please visit jQuery asRange