<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<title>CodePen - Bootstrap Carousel with Swipe functionality</title>
<link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css'><link rel="stylesheet" href="./style.css">
</head>
<body>
<!-- partial:index.partial.html -->
<div id="myCarousel" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="1"></li>
<li data-target="#myCarousel" data-slide-to="2"></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<div class="item active">
<img src="http://photobizx.com/wp-content/uploads/2015/09/Jake-Olson-Photography-Podcast_002.jpg" alt="image">
</div>
<div class="item">
<img src="https://awesomewallpapers.files.wordpress.com/2013/11/s3gxfpn.jpg" alt="image">
</div>
<div class="item">
<img src="http://sparklequotes.com/wp-content/uploads/2016/11/Winter-Status-2.jpg" alt="image">
</div>
</div>
<!-- Left and right controls -->
<a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
<!-- partial -->
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery.touchswipe/1.6.18/jquery.touchSwipe.min.js'></script><script src="./script.js"></script>
</body>
</html>
/*Mixins*/
html {
height: 100%;
}
html body {
min-heigjt: 100%;
overflow: hidden;
}
.carousel .carousel-indicators li {
border: 0px;
background-color: #E9E9E9;
transition: all 0.3s ease;
-webkit-transform: scale(1);
transform: scale(1);
margin-left: 5px;
margin-right: 5px;
}
.carousel .carousel-indicators li.active,
.carousel .carousel-indicators li:hover {
background-color: #FFFFFF;
-webkit-transform: scale(1.3);
transform: scale(1.3);
}
.carousel .carousel-indicators li.active {
margin-left: 5px;
margin-right: 5px;
}
.carousel .carousel-inner .item {
height: 800px;
}
.carousel .carousel-inner .item img {
width: 100%;
height: 100%;
}
.carousel .carousel-control {
transition: -webkit-transform 0.3s ease;
transition: transform 0.3s ease;
transition: transform 0.3s ease, -webkit-transform 0.3s ease;
-webkit-transform: scale(1);
transform: scale(1);
opacity: 1;
text-shadow: none;
background-image: none;
}
.carousel .carousel-control:hover {
-webkit-transform: scale(1.3);
transform: scale(1.3);
background-image: none;
}
$(".carousel").swipe({
excludedElements: "input, select, textarea, .noSwipe",
swipeLeft: function() {
$(this).carousel('next');
},
swipeRight: function() {
$(this).carousel('prev');
},
allowPageScroll: 'vertical'
});