JSFiddle - React, Tailwind, and code Playground
by bizamajig
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/Swiper/3.0.8/js/swiper.jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Swiper/3.0.8/js/swiper.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Swiper/3.0.8/css/swiper.min.css">
<script src="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css">
<!DOCTYPE html>
<body>
<!-- Swiper -->
<div class="swiper-container">
<div id='sortableList' class="swiper-wrapper">
<div class="swiper-slide bg-1">
<span class="glyphicon glyphicon-resize-horizontal"></span>
</div>
<div class="swiper-slide bg-2">
<span class="glyphicon glyphicon-resize-horizontal"></span>
</div>
<div class="swiper-slide bg-3">
<span class="glyphicon glyphicon-resize-horizontal"></span>
</div>
<div class="swiper-slide bg-4">
<span class="glyphicon glyphicon-resize-horizontal"></span>
</div>
<div class="swiper-slide bg-5">
<span class="glyphicon glyphicon-resize-horizontal"></span>
</div>
<div class="swiper-slide bg-6">
<span class="glyphicon glyphicon-resize-horizontal"></span>
</div>
<div class="swiper-slide bg-7">
<span class="glyphicon glyphicon-resize-horizontal"></span>
</div>
<div class="swiper-slide bg-8">
<span class="glyphicon glyphicon-resize-horizontal"></span>
</div>
<div class="swiper-slide bg-9">
<span class="glyphicon glyphicon-resize-horizontal"></span>
</div>
<div class="swiper-slide bg-10">
<span class="glyphicon glyphicon-resize-horizontal"></span>
</div>
</div>
</div>
</body>
CSS
body {
background: #eee;
font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
font-size: 14px;
color: #000;
margin: 0;
padding: 0;
}
.swiper-container {
width: 500px;
height: 300px;
margin: 20px auto;
}
.swiper-slide {
text-align: center;
font-size: 18px;
background: #fff;
/* Center slide text vertically */
display: -webkit-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-box-pack: center;
-ms-flex-pack: center;
-webkit-justify-content: center;
justify-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
-webkit-align-items: center;
align-items: center;
}
.bg-1 {
background-color: #511414;
}
.bg-2 {
background-color: #601F1F;
}
.bg-3 {
background-color: #702B2B;
}
.bg-4 {
background-color: #823B3B;
}
.bg-5 {
background-color: #914D4D;
}
.bg-6 {
background-color: #A35D5D;
}
.bg-7 {
background-color: #B27070;
}
.bg-8 {
background-color: #C18989;
}
.bg-9 {
background-color: #CEA1A1;
}
.bg-10 {
background-color: #DDB8B8;
}
.bg-11 {
background-color: #EFD7D7;
}
.left-top {
vertical-align: top;
text-align: left;
}
JavaScript
var mySwiper = new Swiper('.swiper-container', {
direction: 'horizontal',
//loop: true,
spaceBetween: 0,
slidesPerView: '5'
})
/* :(
*/
$('#sortableList').sortable( {
refreshPositions: true,
opacity: 0.6,
scroll:true,
containment: 'parent',
placeholder: 'placeholder',
tolerance: 'pointer'}).disableSelection();