"Slider with SemanitUI && SlickSlider"
Semantic UI 2.2.10 Snippet by Alessio B.

<link href="//cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.10/semantic.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.10/semantic.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <!------ Include the above in your HEAD tag ----------> <!-- Slick slider --> <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/slick-carousel@1.8.1/slick/slick.min.js"></script> <div class="ui container"> <div class="ui grid"> <div class="sixteen wide column"> <div class="ui segment" style="min-height: 300px"> <div class="ui active loader" id="loader"> </div> <div class="item-slider"> </div> </div> </div> </div> </div>
/* Slider */ .slick-slider { position: relative; display: block; box-sizing: border-box; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; -webkit-touch-callout: none; -khtml-user-select: none; -ms-touch-action: pan-y; touch-action: pan-y; -webkit-tap-highlight-color: transparent; } .slick-list { position: relative; display: block; overflow: hidden; margin: 0; padding: 0; } .slick-list:focus { outline: none; } .slick-list.dragging { cursor: pointer; cursor: hand; } .slick-slider .slick-track, .slick-slider .slick-list { -webkit-transform: translate3d(0, 0, 0); -moz-transform: translate3d(0, 0, 0); -ms-transform: translate3d(0, 0, 0); -o-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); } .slick-track { position: relative; top: 0; left: 0; display: block; margin-left: auto; margin-right: auto; } .slick-track:before, .slick-track:after { display: table; content: ''; } .slick-track:after { clear: both; } .slick-loading .slick-track { visibility: hidden; } .slick-slide { display: none; float: left; height: 100%; min-height: 1px; } [dir='rtl'] .slick-slide { float: right; } .slick-slide img { display: block; } .slick-slide.slick-loading img { display: none; } .slick-slide.dragging img { pointer-events: none; } .slick-initialized .slick-slide { display: block; } .slick-loading .slick-slide { visibility: hidden; } .slick-vertical .slick-slide { display: block; height: auto; border: 1px solid transparent; } .slick-arrow.slick-hidden { display: none; } @charset 'UTF-8'; /* Slider */ /* Icons */ @font-face { font-family: 'slick'; font-weight: normal; font-style: normal; src: url('http://kenwheeler.github.io/slick/slick/fonts/slick.eot'); src: url('http://kenwheeler.github.io/slick/slick/fonts/slick.eot?#iefix') format('embedded-opentype'), url('http://kenwheeler.github.io/slick/slick/fonts/slick.woff') format('woff'), url('http://kenwheeler.github.io/slick/slick/fonts/slick.ttf') format('truetype'), url('./fonts/slick.svg#slick') format('svg'); } /* Arrows */ .slick-prev, .slick-next { font-size: 0; line-height: 0; position: absolute; top: 50%; display: block; width: 20px; height: 20px; padding: 0; -webkit-transform: translate(0, -50%); -ms-transform: translate(0, -50%); transform: translate(0, -50%); cursor: pointer; color: transparent; border: none; outline: none; background: transparent; } .slick-prev:hover, .slick-prev:focus, .slick-next:hover, .slick-next:focus { color: transparent; outline: none; background: transparent; } .slick-prev:hover:before, .slick-prev:focus:before, .slick-next:hover:before, .slick-next:focus:before { opacity: 1; } .slick-prev.slick-disabled:before, .slick-next.slick-disabled:before { opacity: .25; } .slick-prev:before, .slick-next:before { font-family: 'slick'; font-size: 20px; line-height: 1; opacity: .75; color: black; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } .slick-prev { left: -25px; } [dir='rtl'] .slick-prev { right: -25px; left: auto; } .slick-prev:before { content: '←'; } [dir='rtl'] .slick-prev:before { content: '→'; } .slick-next { right: -25px; } [dir='rtl'] .slick-next { right: auto; left: -25px; } .slick-next:before { content: '→'; } [dir='rtl'] .slick-next:before { content: '←'; } /* Dots */ .slick-dotted.slick-slider { margin-bottom: 30px; } .slick-dots { position: absolute; bottom: -25px; display: block; width: 100%; padding: 0; margin: 0; list-style: none; text-align: center; } .slick-dots li { position: relative; display: inline-block; width: 20px; height: 20px; margin: 0 5px; padding: 0; cursor: pointer; } .slick-dots li button { font-size: 0; line-height: 0; display: block; width: 20px; height: 20px; padding: 5px; cursor: pointer; color: transparent; border: 0; outline: none; background: transparent; } .slick-dots li button:hover, .slick-dots li button:focus { outline: none; } .slick-dots li button:hover:before, .slick-dots li button:focus:before { opacity: 1; } .slick-dots li button:before { font-family: 'slick'; font-size: 6px; line-height: 20px; position: absolute; top: 0; left: 0; width: 20px; height: 20px; content: '•'; text-align: center; opacity: .25; color: black; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } .slick-dots li.slick-active button:before { opacity: .75; color: black; }
$( document ).ready(function() { console.log( "ready!" ); $('.item-slider').slick({ dots: true, centerMode: true, variableWidth: true, centerPadding: '10%', slidesToShow: 2, slidesToScroll: 1, autoplay: true, autoplaySpeed: 3000, responsive: [ { breakpoint: 768, settings: { arrows: false, centerMode: true, centerPadding: '40px', slidesToShow: 2 } }, { breakpoint: 480, settings: { arrows: false, centerMode: true, centerPadding: '40px', slidesToShow: 1 } } ] }); for(var i=0;i<5;i++){ var code = '<div class="ui card" style="margin-right:20px">\n'; code += '<div class="content">\n'; code += '<div class="header"> </div>\n'; code += '<div class="description">\n'; code += '<img class="ui left floated rounded image" src="http://placehold.it/128x128">\n'; code += '<div class="ui horizontal divider">\n'; code += 'My Item '+i+'\n'; code += '</div>\n'; code += '<div class="ui label">Level : Great</div>\n'; code += '<div class="ui label">Option : Lucky</div>\n'; code += '<br><br>\n'; code += '<div class="ui horizontal divider">\n'; code += 'Sales\n'; code += '</div>\n'; code += '<a class="ui red right floated tag label">more 10% bonus</a>\n'; code += '<a class="ui red right floated tag label">20%</a>\n'; code += '</div>\n'; code += '</div>\n'; code += '<div class="extra content">\n'; code += '<div class="left floated author">\n'; code += '<img class="ui avatar image" src="https://semantic-ui.com/images/avatar/small/matt.jpg">Matt\n'; code += '</div>\n'; code += '<div class="ui right floated left labeled button" tabindex="0">\n'; code += '<a class="ui basic right pointing label">\n'; code += '20$\n'; code += '</a>\n'; code += '<div class="ui green button">\n'; code += '<i class="shop icon"></i> Buy\n'; code += '</div>\n'; code += '</div>\n'; code += '</div>\n'; code += '</div>'; $('.item-slider').slick('slickAdd',code); } $('#loader').removeClass('active'); });

Related: See More


Questions / Comments: