123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373 |
- <!DOCTYPE html>
- <html>
- <head>
- <title>Slick Playground</title>
- <meta charset="UTF-8">
- <link rel="stylesheet" type="text/css" href="./slick/slick.css">
- <link rel="stylesheet" type="text/css" href="./slick/slick-theme.css">
- <style type="text/css">
- html, body {
- margin: 0;
- padding: 0;
- }
- * {
- box-sizing: border-box;
- }
- .slider {
- width: 50%;
- margin: 100px auto;
- }
- .slick-slide {
- margin: 0px 20px;
- }
- .slick-slide img {
- width: 100%;
- }
- .slick-prev:before,
- .slick-next:before {
- color: black;
- }
- .slick-slide {
- transition: all ease-in-out .3s;
- opacity: .2;
- }
-
- .slick-active {
- opacity: .5;
- }
- .slick-current {
- opacity: 1;
- }
- </style>
- </head>
- <body>
- <section class="vertical-center-4 slider">
- <div>
- <img src="http://placehold.it/350x100?text=1">
- </div>
- <div>
- <img src="http://placehold.it/350x100?text=2">
- </div>
- <div>
- <img src="http://placehold.it/350x100?text=3">
- </div>
- <div>
- <img src="http://placehold.it/350x100?text=4">
- </div>
- <div>
- <img src="http://placehold.it/350x100?text=5">
- </div>
- <div>
- <img src="http://placehold.it/350x100?text=6">
- </div>
- <div>
- <img src="http://placehold.it/350x100?text=7">
- </div>
- <div>
- <img src="http://placehold.it/350x100?text=8">
- </div>
- <div>
- <img src="http://placehold.it/350x100?text=9">
- </div>
- <div>
- <img src="http://placehold.it/350x100?text=10">
- </div>
- </section>
- <section class="vertical-center-3 slider">
- <div>
- <img src="http://placehold.it/350x100?text=1">
- </div>
- <div>
- <img src="http://placehold.it/350x100?text=2">
- </div>
- <div>
- <img src="http://placehold.it/350x100?text=3">
- </div>
- <div>
- <img src="http://placehold.it/350x100?text=4">
- </div>
- <div>
- <img src="http://placehold.it/350x100?text=5">
- </div>
- <div>
- <img src="http://placehold.it/350x100?text=6">
- </div>
- <div>
- <img src="http://placehold.it/350x100?text=7">
- </div>
- <div>
- <img src="http://placehold.it/350x100?text=8">
- </div>
- <div>
- <img src="http://placehold.it/350x100?text=9">
- </div>
- <div>
- <img src="http://placehold.it/350x100?text=10">
- </div>
- </section>
- <section class="vertical-center-2 slider">
- <div>
- <img src="http://placehold.it/350x100?text=1">
- </div>
- <div>
- <img src="http://placehold.it/350x100?text=2">
- </div>
- <div>
- <img src="http://placehold.it/350x100?text=3">
- </div>
- <div>
- <img src="http://placehold.it/350x100?text=4">
- </div>
- <div>
- <img src="http://placehold.it/350x100?text=5">
- </div>
- <div>
- <img src="http://placehold.it/350x100?text=6">
- </div>
- <div>
- <img src="http://placehold.it/350x100?text=7">
- </div>
- <div>
- <img src="http://placehold.it/350x100?text=8">
- </div>
- <div>
- <img src="http://placehold.it/350x100?text=9">
- </div>
- <div>
- <img src="http://placehold.it/350x100?text=10">
- </div>
- </section>
- <section class="vertical-center slider">
- <div>
- <img src="http://placehold.it/350x100?text=1">
- </div>
- <div>
- <img src="http://placehold.it/350x100?text=2">
- </div>
- <div>
- <img src="http://placehold.it/350x100?text=3">
- </div>
- <div>
- <img src="http://placehold.it/350x100?text=4">
- </div>
- <div>
- <img src="http://placehold.it/350x100?text=5">
- </div>
- <div>
- <img src="http://placehold.it/350x100?text=6">
- </div>
- <div>
- <img src="http://placehold.it/350x100?text=7">
- </div>
- <div>
- <img src="http://placehold.it/350x100?text=8">
- </div>
- <div>
- <img src="http://placehold.it/350x100?text=9">
- </div>
- <div>
- <img src="http://placehold.it/350x100?text=10">
- </div>
- </section>
- <section class="vertical slider">
- <div>
- <img src="http://placehold.it/350x100?text=1">
- </div>
- <div>
- <img src="http://placehold.it/350x100?text=2">
- </div>
- <div>
- <img src="http://placehold.it/350x100?text=3">
- </div>
- <div>
- <img src="http://placehold.it/350x100?text=4">
- </div>
- <div>
- <img src="http://placehold.it/350x100?text=5">
- </div>
- <div>
- <img src="http://placehold.it/350x100?text=6">
- </div>
- <div>
- <img src="http://placehold.it/350x100?text=7">
- </div>
- <div>
- <img src="http://placehold.it/350x100?text=8">
- </div>
- <div>
- <img src="http://placehold.it/350x100?text=9">
- </div>
- <div>
- <img src="http://placehold.it/350x100?text=10">
- </div>
- </section>
- <section class="regular slider">
- <div>
- <img src="http://placehold.it/350x300?text=1">
- </div>
- <div>
- <img src="http://placehold.it/350x300?text=2">
- </div>
- <div>
- <img src="http://placehold.it/350x300?text=3">
- </div>
- <div>
- <img src="http://placehold.it/350x300?text=4">
- </div>
- <div>
- <img src="http://placehold.it/350x300?text=5">
- </div>
- <div>
- <img src="http://placehold.it/350x300?text=6">
- </div>
- </section>
- <section class="center slider">
- <div>
- <img src="http://placehold.it/350x300?text=1">
- </div>
- <div>
- <img src="http://placehold.it/350x300?text=2">
- </div>
- <div>
- <img src="http://placehold.it/350x300?text=3">
- </div>
- <div>
- <img src="http://placehold.it/350x300?text=4">
- </div>
- <div>
- <img src="http://placehold.it/350x300?text=5">
- </div>
- <div>
- <img src="http://placehold.it/350x300?text=6">
- </div>
- <div>
- <img src="http://placehold.it/350x300?text=7">
- </div>
- <div>
- <img src="http://placehold.it/350x300?text=8">
- </div>
- <div>
- <img src="http://placehold.it/350x300?text=9">
- </div>
- </section>
- <section class="variable slider">
- <div>
- <img src="http://placehold.it/350x300?text=1">
- </div>
- <div>
- <img src="http://placehold.it/200x300?text=2">
- </div>
- <div>
- <img src="http://placehold.it/100x300?text=3">
- </div>
- <div>
- <img src="http://placehold.it/200x300?text=4">
- </div>
- <div>
- <img src="http://placehold.it/350x300?text=5">
- </div>
- <div>
- <img src="http://placehold.it/300x300?text=6">
- </div>
- </section>
- <section class="lazy slider" data-sizes="50vw">
- <div>
- <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">
- </div>
- <div>
- <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">
- </div>
- <div>
- <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">
- </div>
- <div>
- <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">
- </div>
- <div>
- <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">
- </div>
- <div>
- <!-- this slide should inherit the sizes attr from the parent slider -->
- <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">
- </div>
- </section>
- <script src="https://code.jquery.com/jquery-2.2.0.min.js" type="text/javascript"></script>
- <script src="./slick/slick.js" type="text/javascript" charset="utf-8"></script>
- <script type="text/javascript">
- $(document).on('ready', function() {
- $(".vertical-center-4").slick({
- dots: true,
- vertical: true,
- centerMode: true,
- slidesToShow: 4,
- slidesToScroll: 2
- });
- $(".vertical-center-3").slick({
- dots: true,
- vertical: true,
- centerMode: true,
- slidesToShow: 3,
- slidesToScroll: 3
- });
- $(".vertical-center-2").slick({
- dots: true,
- vertical: true,
- centerMode: true,
- slidesToShow: 2,
- slidesToScroll: 2
- });
- $(".vertical-center").slick({
- dots: true,
- vertical: true,
- centerMode: true,
- });
- $(".vertical").slick({
- dots: true,
- vertical: true,
- slidesToShow: 3,
- slidesToScroll: 3
- });
- $(".regular").slick({
- dots: true,
- infinite: true,
- slidesToShow: 3,
- slidesToScroll: 3
- });
- $(".center").slick({
- dots: true,
- infinite: true,
- centerMode: true,
- slidesToShow: 5,
- slidesToScroll: 3
- });
- $(".variable").slick({
- dots: true,
- infinite: true,
- variableWidth: true
- });
- $(".lazy").slick({
- lazyLoad: 'ondemand', // ondemand progressive anticipated
- infinite: true
- });
- });
- </script>
- </body>
- </html>
|