"Full Screen Vertical Carousel with Mouse Scroll and Swipe"
Bootstrap 3.3.0 Snippet by Utsavi Shah

<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <section class="slide-wrapper"> <div class="container"> <div id="myCarousel" class="carousel slide"> <!-- 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> <li data-target="#myCarousel" data-slide-to="3"></li> </ol> <!-- Wrapper for slides --> <div class="carousel-inner"> <div class="item active"> <div class="fill" style=" background-color:#48c3af; background-image:url(http://www.mrwallpaper.com/wallpapers/dandelion-Background.jpg);"></div> </div> <div class="item"> <div class="fill" style="background-color:#b33f4a;background-image:url(http://3.bp.blogspot.com/-OLdE-ALRH7Y/TcABVGXzufI/AAAAAAAAAEY/aU0a9roJhtc/s1600/Amazing++Beautiful+Fresh+Flowers+%25281%2529.jpg);"></div> </div> <div class="item"> <div class="fill" style="background-color:#7fc2f4;background-image:url(https://images6.alphacoders.com/347/347733.jpg);"></div> </div> <div class="item"> <div class="fill" style="background-color:#e47794; background-image:url(http://hdwallpaperbackgrounds.net/wp-content/uploads/2015/07/Flower-Backgrounds-HD-Wallpaper-7.jpg);"></div> </div> </div> </div> </div> </section>
html, body{ width:100%; height:100%; background-color:#fff; } .carousel-inner,.carousel,.item,.container,.fill { height:100%; width:100%; background-position:center center; background-size:cover; } .slide-wrapper{display:inline;} .slide-wrapper .container{padding:0px;} /*------------------------------ vertical bootstrap slider----------------------------*/ .carousel-inner> .item.next , .carousel-inner > .item.active.right{ transform: translate3d(0, 100%, 0); -webkit-transform: translate3d(0, 100%, 0); -ms-transform: translate3d(0, 100%, 0); -moz-transform: translate3d(0, 100%, 0); -o-transform: translate3d(0, 100%, 0); top: 0;} .carousel-inner > .item.prev ,.carousel-inner > .item.active.left{ transform: translate3d(0,-100%, 0); -webkit-transform: translate3d(0,-100%, 0); -moz-transform: translate3d(0,-100%, 0);-ms-transform: translate3d(0,-100%, 0); -o-transform: translate3d(0,-100%, 0); top: 0;} .carousel-inner > .item.next.left , .carousel-inner > .item.prev.right , .carousel-inner > .item.active{transform:translate3d(0,0,0); -webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);; -moz-transform:translate3d(0,0,0); -o-transform:translate3d(0,0,0); top:0;} /*------------------------------- vertical carousel indicators ------------------------------*/ .carousel-indicators{ position:absolute; top:0; bottom:0; margin:auto; height:20px; right:10px; left:auto; width:auto; } .carousel-indicators li{display:block; margin-bottom:5px; border:1px solid #00a199; } .carousel-indicators li.active{margin-bottom:5px; background:#00a199;}
$(document).ready(function(){ // invoke the carousel $('#myCarousel').carousel({ interval: false }); // scroll slides on mouse scroll $('#myCarousel').bind('mousewheel DOMMouseScroll', function(e){ if(e.originalEvent.wheelDelta > 0 || e.originalEvent.detail < 0) { $(this).carousel('prev'); } else{ $(this).carousel('next'); } }); //scroll slides on swipe for touch enabled devices $("#myCarousel").on("touchstart", function(event){ var yClick = event.originalEvent.touches[0].pageY; $(this).one("touchmove", function(event){ var yMove = event.originalEvent.touches[0].pageY; if( Math.floor(yClick - yMove) > 1 ){ $(".carousel").carousel('next'); } else if( Math.floor(yClick - yMove) < -1 ){ $(".carousel").carousel('prev'); } }); $(".carousel").on("touchend", function(){ $(this).off("touchmove"); }); }); });

Related: See More


Questions / Comments:

Is it posible to disable cycling? I mean, when you arrive to the last slide, stop and not go back to the first

joseanmola () - 4 years ago - Reply 0


I have added this in last one, see HTML line no 29

<div class="item">

<div class="fill" style="background-color:#e47794; background-image:url(http://hdwallpaperbackgrounds.net/wp-content/uploads/2015/07/Flower-Backgrounds-HD-Wallpaper-7.jpg);">

<span id="last" class="d-none">4</span>

</div>

</div>

then on JQuery :

$('#myCarousel').bind('mousewheel DOMMouseScroll', function (e) {

if (e.originalEvent.wheelDelta > 0 || e.originalEvent.detail < 0) {

$(this).carousel('prev');

}

else {

if(e.target.lastElementChild){

if(e.target.lastElementChild.innerText != '4' ){

$(this).carousel('next');

}

} else{

$(this).carousel('next');

}

}

});

jahanzaib76 (-1) - 4 years ago - Reply 0


i dont see any difference between this and scrollspy?

I need a no-scrollbar with up/down flinger like on android app......

scrollbars are ugly...

cellurl (1) - 5 years ago - Reply 0


Kissanime is the web where you can enjoy the best of the anime shows online. Kiss Anime is a site that delivers high definition toon videos for free

kiss anime () - 7 years ago - Reply 0