| 1 |
<!DOCTYPE html> |
| 2 |
<html> |
| 3 |
<head> |
| 4 |
<title>Slick Playground</title> |
| 5 |
<meta charset="UTF-8"> |
| 6 |
<link rel="stylesheet" type="text/css" href="./slick/slick.css"> |
| 7 |
<link rel="stylesheet" type="text/css" href="./slick/slick-theme.css"> |
| 8 |
<style type="text/css"> |
| 9 |
html, body { |
| 10 |
margin: 0; |
| 11 |
padding: 0; |
| 12 |
} |
| 13 |
|
| 14 |
* { |
| 15 |
box-sizing: border-box; |
| 16 |
} |
| 17 |
|
| 18 |
.slider { |
| 19 |
width: 50%; |
| 20 |
margin: 100px auto; |
| 21 |
} |
| 22 |
|
| 23 |
.slick-slide { |
| 24 |
margin: 0px 20px; |
| 25 |
} |
| 26 |
|
| 27 |
.slick-slide img { |
| 28 |
width: 100%; |
| 29 |
} |
| 30 |
|
| 31 |
.slick-prev:before, |
| 32 |
.slick-next:before { |
| 33 |
color: black; |
| 34 |
} |
| 35 |
|
| 36 |
|
| 37 |
.slick-slide { |
| 38 |
transition: all ease-in-out .3s; |
| 39 |
opacity: .2; |
| 40 |
} |
| 41 |
|
| 42 |
.slick-active { |
| 43 |
opacity: .5; |
| 44 |
} |
| 45 |
|
| 46 |
.slick-current { |
| 47 |
opacity: 1; |
| 48 |
} |
| 49 |
</style> |
| 50 |
</head> |
| 51 |
<body> |
| 52 |
|
| 53 |
<section class="vertical-center-4 slider"> |
| 54 |
<div> |
| 55 |
<img src="http://placehold.it/350x100?text=1"> |
| 56 |
</div> |
| 57 |
<div> |
| 58 |
<img src="http://placehold.it/350x100?text=2"> |
| 59 |
</div> |
| 60 |
<div> |
| 61 |
<img src="http://placehold.it/350x100?text=3"> |
| 62 |
</div> |
| 63 |
<div> |
| 64 |
<img src="http://placehold.it/350x100?text=4"> |
| 65 |
</div> |
| 66 |
<div> |
| 67 |
<img src="http://placehold.it/350x100?text=5"> |
| 68 |
</div> |
| 69 |
<div> |
| 70 |
<img src="http://placehold.it/350x100?text=6"> |
| 71 |
</div> |
| 72 |
<div> |
| 73 |
<img src="http://placehold.it/350x100?text=7"> |
| 74 |
</div> |
| 75 |
<div> |
| 76 |
<img src="http://placehold.it/350x100?text=8"> |
| 77 |
</div> |
| 78 |
<div> |
| 79 |
<img src="http://placehold.it/350x100?text=9"> |
| 80 |
</div> |
| 81 |
<div> |
| 82 |
<img src="http://placehold.it/350x100?text=10"> |
| 83 |
</div> |
| 84 |
</section> |
| 85 |
|
| 86 |
<section class="vertical-center-3 slider"> |
| 87 |
<div> |
| 88 |
<img src="http://placehold.it/350x100?text=1"> |
| 89 |
</div> |
| 90 |
<div> |
| 91 |
<img src="http://placehold.it/350x100?text=2"> |
| 92 |
</div> |
| 93 |
<div> |
| 94 |
<img src="http://placehold.it/350x100?text=3"> |
| 95 |
</div> |
| 96 |
<div> |
| 97 |
<img src="http://placehold.it/350x100?text=4"> |
| 98 |
</div> |
| 99 |
<div> |
| 100 |
<img src="http://placehold.it/350x100?text=5"> |
| 101 |
</div> |
| 102 |
<div> |
| 103 |
<img src="http://placehold.it/350x100?text=6"> |
| 104 |
</div> |
| 105 |
<div> |
| 106 |
<img src="http://placehold.it/350x100?text=7"> |
| 107 |
</div> |
| 108 |
<div> |
| 109 |
<img src="http://placehold.it/350x100?text=8"> |
| 110 |
</div> |
| 111 |
<div> |
| 112 |
<img src="http://placehold.it/350x100?text=9"> |
| 113 |
</div> |
| 114 |
<div> |
| 115 |
<img src="http://placehold.it/350x100?text=10"> |
| 116 |
</div> |
| 117 |
</section> |
| 118 |
|
| 119 |
<section class="vertical-center-2 slider"> |
| 120 |
<div> |
| 121 |
<img src="http://placehold.it/350x100?text=1"> |
| 122 |
</div> |
| 123 |
<div> |
| 124 |
<img src="http://placehold.it/350x100?text=2"> |
| 125 |
</div> |
| 126 |
<div> |
| 127 |
<img src="http://placehold.it/350x100?text=3"> |
| 128 |
</div> |
| 129 |
<div> |
| 130 |
<img src="http://placehold.it/350x100?text=4"> |
| 131 |
</div> |
| 132 |
<div> |
| 133 |
<img src="http://placehold.it/350x100?text=5"> |
| 134 |
</div> |
| 135 |
<div> |
| 136 |
<img src="http://placehold.it/350x100?text=6"> |
| 137 |
</div> |
| 138 |
<div> |
| 139 |
<img src="http://placehold.it/350x100?text=7"> |
| 140 |
</div> |
| 141 |
<div> |
| 142 |
<img src="http://placehold.it/350x100?text=8"> |
| 143 |
</div> |
| 144 |
<div> |
| 145 |
<img src="http://placehold.it/350x100?text=9"> |
| 146 |
</div> |
| 147 |
<div> |
| 148 |
<img src="http://placehold.it/350x100?text=10"> |
| 149 |
</div> |
| 150 |
</section> |
| 151 |
|
| 152 |
<section class="vertical-center slider"> |
| 153 |
<div> |
| 154 |
<img src="http://placehold.it/350x100?text=1"> |
| 155 |
</div> |
| 156 |
<div> |
| 157 |
<img src="http://placehold.it/350x100?text=2"> |
| 158 |
</div> |
| 159 |
<div> |
| 160 |
<img src="http://placehold.it/350x100?text=3"> |
| 161 |
</div> |
| 162 |
<div> |
| 163 |
<img src="http://placehold.it/350x100?text=4"> |
| 164 |
</div> |
| 165 |
<div> |
| 166 |
<img src="http://placehold.it/350x100?text=5"> |
| 167 |
</div> |
| 168 |
<div> |
| 169 |
<img src="http://placehold.it/350x100?text=6"> |
| 170 |
</div> |
| 171 |
<div> |
| 172 |
<img src="http://placehold.it/350x100?text=7"> |
| 173 |
</div> |
| 174 |
<div> |
| 175 |
<img src="http://placehold.it/350x100?text=8"> |
| 176 |
</div> |
| 177 |
<div> |
| 178 |
<img src="http://placehold.it/350x100?text=9"> |
| 179 |
</div> |
| 180 |
<div> |
| 181 |
<img src="http://placehold.it/350x100?text=10"> |
| 182 |
</div> |
| 183 |
</section> |
| 184 |
|
| 185 |
<section class="vertical slider"> |
| 186 |
<div> |
| 187 |
<img src="http://placehold.it/350x100?text=1"> |
| 188 |
</div> |
| 189 |
<div> |
| 190 |
<img src="http://placehold.it/350x100?text=2"> |
| 191 |
</div> |
| 192 |
<div> |
| 193 |
<img src="http://placehold.it/350x100?text=3"> |
| 194 |
</div> |
| 195 |
<div> |
| 196 |
<img src="http://placehold.it/350x100?text=4"> |
| 197 |
</div> |
| 198 |
<div> |
| 199 |
<img src="http://placehold.it/350x100?text=5"> |
| 200 |
</div> |
| 201 |
<div> |
| 202 |
<img src="http://placehold.it/350x100?text=6"> |
| 203 |
</div> |
| 204 |
<div> |
| 205 |
<img src="http://placehold.it/350x100?text=7"> |
| 206 |
</div> |
| 207 |
<div> |
| 208 |
<img src="http://placehold.it/350x100?text=8"> |
| 209 |
</div> |
| 210 |
<div> |
| 211 |
<img src="http://placehold.it/350x100?text=9"> |
| 212 |
</div> |
| 213 |
<div> |
| 214 |
<img src="http://placehold.it/350x100?text=10"> |
| 215 |
</div> |
| 216 |
</section> |
| 217 |
<section class="regular slider"> |
| 218 |
<div> |
| 219 |
<img src="http://placehold.it/350x300?text=1"> |
| 220 |
</div> |
| 221 |
<div> |
| 222 |
<img src="http://placehold.it/350x300?text=2"> |
| 223 |
</div> |
| 224 |
<div> |
| 225 |
<img src="http://placehold.it/350x300?text=3"> |
| 226 |
</div> |
| 227 |
<div> |
| 228 |
<img src="http://placehold.it/350x300?text=4"> |
| 229 |
</div> |
| 230 |
<div> |
| 231 |
<img src="http://placehold.it/350x300?text=5"> |
| 232 |
</div> |
| 233 |
<div> |
| 234 |
<img src="http://placehold.it/350x300?text=6"> |
| 235 |
</div> |
| 236 |
</section> |
| 237 |
|
| 238 |
<section class="center slider"> |
| 239 |
<div> |
| 240 |
<img src="http://placehold.it/350x300?text=1"> |
| 241 |
</div> |
| 242 |
<div> |
| 243 |
<img src="http://placehold.it/350x300?text=2"> |
| 244 |
</div> |
| 245 |
<div> |
| 246 |
<img src="http://placehold.it/350x300?text=3"> |
| 247 |
</div> |
| 248 |
<div> |
| 249 |
<img src="http://placehold.it/350x300?text=4"> |
| 250 |
</div> |
| 251 |
<div> |
| 252 |
<img src="http://placehold.it/350x300?text=5"> |
| 253 |
</div> |
| 254 |
<div> |
| 255 |
<img src="http://placehold.it/350x300?text=6"> |
| 256 |
</div> |
| 257 |
<div> |
| 258 |
<img src="http://placehold.it/350x300?text=7"> |
| 259 |
</div> |
| 260 |
<div> |
| 261 |
<img src="http://placehold.it/350x300?text=8"> |
| 262 |
</div> |
| 263 |
<div> |
| 264 |
<img src="http://placehold.it/350x300?text=9"> |
| 265 |
</div> |
| 266 |
</section> |
| 267 |
|
| 268 |
<section class="variable slider"> |
| 269 |
<div> |
| 270 |
<img src="http://placehold.it/350x300?text=1"> |
| 271 |
</div> |
| 272 |
<div> |
| 273 |
<img src="http://placehold.it/200x300?text=2"> |
| 274 |
</div> |
| 275 |
<div> |
| 276 |
<img src="http://placehold.it/100x300?text=3"> |
| 277 |
</div> |
| 278 |
<div> |
| 279 |
<img src="http://placehold.it/200x300?text=4"> |
| 280 |
</div> |
| 281 |
<div> |
| 282 |
<img src="http://placehold.it/350x300?text=5"> |
| 283 |
</div> |
| 284 |
<div> |
| 285 |
<img src="http://placehold.it/300x300?text=6"> |
| 286 |
</div> |
| 287 |
</section> |
| 288 |
|
| 289 |
<section class="lazy slider" data-sizes="50vw"> |
| 290 |
<div> |
| 291 |
<img data-lazy="http://placehold.it/350x300?text=1-350w" data-srcset="http://placehold.it/650x300?text=1-650w 650w, http://placehold.it/960x300?text=1-960w 960w" data-sizes="100vw"> |
| 292 |
</div> |
| 293 |
<div> |
| 294 |
<img data-lazy="http://placehold.it/350x300?text=2-350w" data-srcset="http://placehold.it/650x300?text=2-650w 650w, http://placehold.it/960x300?text=2-960w 960w" data-sizes="100vw"> |
| 295 |
</div> |
| 296 |
<div> |
| 297 |
<img data-lazy="http://placehold.it/350x300?text=3-350w" data-srcset="http://placehold.it/650x300?text=3-650w 650w, http://placehold.it/960x300?text=3-960w 960w" data-sizes="100vw"> |
| 298 |
</div> |
| 299 |
<div> |
| 300 |
<img data-lazy="http://placehold.it/350x300?text=4-350w" data-srcset="http://placehold.it/650x300?text=4-650w 650w, http://placehold.it/960x300?text=4-960w 960w" data-sizes="100vw"> |
| 301 |
</div> |
| 302 |
<div> |
| 303 |
<img data-lazy="http://placehold.it/350x300?text=5-350w" data-srcset="http://placehold.it/650x300?text=5-650w 650w, http://placehold.it/960x300?text=5-960w 960w" data-sizes="100vw"> |
| 304 |
</div> |
| 305 |
<div> |
| 306 |
<!-- this slide should inherit the sizes attr from the parent slider --> |
| 307 |
<img data-lazy="http://placehold.it/350x300?text=6-350w" data-srcset="http://placehold.it/650x300?text=6-650w 650w, http://placehold.it/960x300?text=6-960w 960w"> |
| 308 |
</div> |
| 309 |
</section> |
| 310 |
|
| 311 |
<script src="https://code.jquery.com/jquery-2.2.0.min.js" type="text/javascript"></script> |
| 312 |
<script src="./slick/slick.js" type="text/javascript" charset="utf-8"></script> |
| 313 |
<script type="text/javascript"> |
| 314 |
$(document).on('ready', function() { |
| 315 |
$(".vertical-center-4").slick({ |
| 316 |
dots: true, |
| 317 |
vertical: true, |
| 318 |
centerMode: true, |
| 319 |
slidesToShow: 4, |
| 320 |
slidesToScroll: 2 |
| 321 |
}); |
| 322 |
$(".vertical-center-3").slick({ |
| 323 |
dots: true, |
| 324 |
vertical: true, |
| 325 |
centerMode: true, |
| 326 |
slidesToShow: 3, |
| 327 |
slidesToScroll: 3 |
| 328 |
}); |
| 329 |
$(".vertical-center-2").slick({ |
| 330 |
dots: true, |
| 331 |
vertical: true, |
| 332 |
centerMode: true, |
| 333 |
slidesToShow: 2, |
| 334 |
slidesToScroll: 2 |
| 335 |
}); |
| 336 |
$(".vertical-center").slick({ |
| 337 |
dots: true, |
| 338 |
vertical: true, |
| 339 |
centerMode: true, |
| 340 |
}); |
| 341 |
$(".vertical").slick({ |
| 342 |
dots: true, |
| 343 |
vertical: true, |
| 344 |
slidesToShow: 3, |
| 345 |
slidesToScroll: 3 |
| 346 |
}); |
| 347 |
$(".regular").slick({ |
| 348 |
dots: true, |
| 349 |
infinite: true, |
| 350 |
slidesToShow: 3, |
| 351 |
slidesToScroll: 3 |
| 352 |
}); |
| 353 |
$(".center").slick({ |
| 354 |
dots: true, |
| 355 |
infinite: true, |
| 356 |
centerMode: true, |
| 357 |
slidesToShow: 5, |
| 358 |
slidesToScroll: 3 |
| 359 |
}); |
| 360 |
$(".variable").slick({ |
| 361 |
dots: true, |
| 362 |
infinite: true, |
| 363 |
variableWidth: true |
| 364 |
}); |
| 365 |
$(".lazy").slick({ |
| 366 |
lazyLoad: 'ondemand', // ondemand progressive anticipated |
| 367 |
infinite: true |
| 368 |
}); |
| 369 |
}); |
| 370 |
</script> |
| 371 |
|
| 372 |
</body> |
| 373 |
</html> |