-
Notifications
You must be signed in to change notification settings - Fork 16
/
slick.jquery.txt
88 lines (80 loc) · 7.09 KB
/
slick.jquery.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
SLICK
ALTERNATIVES ==> # - cycle2
# - slick (prefer)
VERSION ==> #Carousel. 1.4.1
JQ.click([OBJ]) #JQ is <any> with <any> children (the slides).
#Can also use data-slick="JSON_OBJ"
#CSS:
# - .slick-active: slide completely shown on screen, including current slide
# - .slick-center: current slide
#OBJ:
# - accessibility BOOL (def: true): let user use keyboard
# - dragging BOOL (def: true): mouse dragging
# - swipe BOOL (def: true): swiping
# - touchMove BOOL (def: true): swipe can change slides
# - touchThreshold NUM (def: 5)
# - arrows BOOL (def: true): show UI arrows
# - prev|nextArrow HTML_STR|JQ|ELEM: UI arrows templates. Def:
# <button type="button" class="slick-prev|next">Previous|Next</button>
# - appendArrows SELECTOR (def: current JQ): where UI arrows are appended in the DOM
# - autoplay BOOL (def: false): make slide move automatically
# - autoplaySpeed NUM (def: 3000)
# - pauseOn[Dots]Hover BOOL (def: true): when autoplay true
# - adaptiveHeight BOOL (def: false): make container height adapt to current slide
# (with slidesToShow 1)
# - variableWidth BOOL (def: false): to use if slides have different width
# - asNavFor ID_STR|CLASS_STR: make the carousel move another one too, to have them in sync.
# For bidirectional sync, must put asNavFor on each other.
# - slidesToShow NUM (def: 1): number of slides to show at once
# - slidesToScroll NUM (def: 1): number of slides to scroll at once
# - swipeToScroll BOOL (def: false): make swipe able to circumvent slidesToScroll
# - centerMode BOOL (def: false): with odd number for slidesToShow, show half-cut slides on
# each side
# - centerPadding CSS_STR (def: "50px"): when centerMode true. How much "half-cut" means.
# - vertical BOOL (def: false): vertical mode
# - rtl BOOL (def: false): change direction
# - infinite BOOL (def: true): connect begin to end
# - edgeFriction NUM (def: 0.15): friction when moving being|end slides (if infinite false)
# - speed NUM (def: 300): animation speed
# - useCSS BOOL (def: true): use CSS transitions
# - cssEase STR (def: "ease"): CSS3 animation easing. If useCSS true.
# - easing STR (def: "linear"): jQuery UI easing. If useCSS false and jQuery UI loaded.
# - fade BOOL (def: false): use fade transition instead of slide
# - dots BOOL (def: false): show dots pagination
# - customPaging(JQ, NUM)->HTML_STR: dots template, def to:
# <button type="button" data-role="none">NUM+1</button>
# - focusOnSelect BOOL (def: false)
# - initialSlide NUM (def: 0)
# - slide ELEM: current slide
# - lazyLoad STR: "ondemand" (def) or "progressive"
# Lazy loading happend by using <img data-lazy="URL"> instead of <img src="URL">, which
# will be replaced by the second by Slick.
# "ondemand" loads more slides in advance, "progressive" only loads current ones.
# - responsive OBJ2: with OBJ2.breakpoint NUM and OBJ2.settings OBJ.
# Use different settings OBJ according to range width NUM
# - respondTo STR: what width is used for breakpoint NUM: "window" (def), "slider" or "min"
# (min. of "window" or "slider")
# - mobileFirst BOOL (def: false): check breakpoint NUM starting from bottom, not top.
# E.g. breakpoints 500, 800: if width 700 and mobileFirst, use 500, otherwise 800
JQ.slick("slickCurrentSlide") #Returns NUM
JQ.slick("slickGoTo", NUM[, BOOL])#If true, does not animate
JQ.slick("slickNext|Prev") #
JQ.slick("slickPause|Play") #For autoplay
JQ.slick("slickAdd",HTML_STR|ELEM,
NUM[, BOOL]) #BOOL is whether before (false) or after (true, def)
JQ.slick("slickRemove",NUM[,BOOL])#
JQ.slick("slickFilter", VAL) #Calls JQ.filter(VAL)
JQ.click("slickUnfilter") #
JQ.click("slickGetOption",VAR_STR)#
JQ.click("slickSetOption",
VAR_STR, VAL[, BOOL]) #If true, refresh (to do if changes UI)
JQ.click("unslick") #Destroy
JQ.on("init|reInit", FUNC()) #
JQ.on("beforeChange",
FUNC(JQ, NUM, NUM2)) #
JQ.on("afterChange",FUNC(JQ, NUM))#When changing slide
JQ.on("swipe", FUNC(JQ, STR)) #When dragging/swiping. STR is "left|right"
JQ.on("edge", FUNC(JQ, STR)) #When trying to go beyong begin|end and infinite is false. STR is "left|right"
JQ.on("setPosition", FUNC(JQ)) #When position/size changes.