"carousel"
Bootstrap 3.0.0 Snippet by evarevirus

<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.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 ----------> <!DOCTYPE html><html class=''> <head><script src='//production-assets.codepen.io/assets/editor/live/console_runner-079c09a0e3b9ff743e39ee2d5637b9216b3545af0de366d4b9aad9dc87e26bfd.js'></script><script src='//production-assets.codepen.io/assets/editor/live/events_runner-73716630c22bbc8cff4bd0f07b135f00a0bdc5d14629260c3ec49e5606f98fdd.js'></script><script src='//production-assets.codepen.io/assets/editor/live/css_live_reload_init-2c0dc5167d60a5af3ee189d570b1835129687ea2a61bee3513dee3a50c115a77.js'></script><meta charset='UTF-8'><meta name="robots" content="noindex"><link rel="shortcut icon" type="image/x-icon" href="//production-assets.codepen.io/assets/favicon/favicon-8ea04875e70c4b0bb41da869e81236e54394d63638a1ef12fa558a4a835f1164.ico" /><link rel="mask-icon" type="" href="//production-assets.codepen.io/assets/favicon/logo-pin-f2d2b6d2c61838f7e76325261b7195c27224080bc099486ddd6dccb469b8e8e6.svg" color="#111" /><link rel="canonical" href="https://codepen.io/jonathan/pen/QjzZpO?q=auto%20scroll&limit=all&order=popularity&depth=everything&show_forks=false" /> <style class="cp-pen-styles">* { box-sizing:content-box; } html{ height:100%; /* allows body tag to take full height */ } body { margin:0 30px; padding: 0; height: 100%; overflow: hidden; background: #444; color:#FFF; } p { text-align:center; font-weight:bold; font-family:Arial,san-serif; text-transform:uppercase; } .landing-wrapper { width: 99.9%; height: 280px; margin:20px auto; padding:0; position: relative; overflow:hidden; border:1px solid #333; cursor:pointer; } .landing-inner-content { background: #FFF; width: 2620px; height: 280px; } .box { position: relative; background: rgba(0, 50, 502, 0.3); width: 240px; height: 240px; margin: 20px 20px 0 0; float: left; overflow:hidden; } .box:first-of-type { margin-left:20px; } .box:last-of-type { margin-right:20px; } .box-content { background: #000; /*margin-left: auto; margin-right: auto;*/ position: absolute; top:0; left:0; z-index: 999; } .box-content img { width: 100%; }</style></head><body> <p>hover over the images to auto scroll the images left or right</p> <div class="landing-wrapper"> <div class="landing-inner-content"> <div class="box box-1"> <div class="box-content"> <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/56901/240x240.png"> </div> </div> <div class="box box-2"> <div class="box-content"> <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/56901/240x240.png"> </div> </div> <div class="box box-3"> <div class="box-content"> <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/56901/240x240.png"> </div> </div> <div class="box box-4"> <div class="box-content"> <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/56901/240x240.png"> </div> </div> <div class="box box-5"> <div class="box-content"> <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/56901/240x240.png"> </div> </div> <div class="box box-6"> <div class="box-content"> <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/56901/240x240.png"> </div> </div> <div class="box box-7"> <div class="box-content"> <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/56901/240x240.png"> </div> </div> <div class="box box-8"> <div class="box-content"> <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/56901/240x240.png"> </div> </div> <div class="box box-9"> <div class="box-content"> <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/56901/240x240.png"> </div> </div> <div class="box box-10"> <div class="box-content"> <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/56901/240x240.png"> </div> </div> </div> </div> <script src='//production-assets.codepen.io/assets/common/stopExecutionOnTimeout-b2a7b3fe212eaa732349046d8416e00a9dec26eb7fd347590fbced3ab38af52e.js'></script><script src='//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script><script src='//cdnjs.cloudflare.com/ajax/libs/gsap/1.18.0/TweenMax.min.js'></script><script src='//cdnjs.cloudflare.com/ajax/libs/gsap/1.18.0/plugins/ScrollToPlugin.min.js'></script> <script >$(window).on("load", function() { var $landingWrapper = $(".landing-wrapper"), $landingInnerContent = $(".landing-inner-content"); // set initial container to half of .landing-inner-content width //TweenMax.set($landingWrapper, {scrollTo: {x: $landingInnerContent.width()/4}, ease: Power2.easeOut}); // scroll left and right $landingInnerContent.on("mousemove touchmove", function(e) { if (e.clientX > $landingWrapper.width() / 2) { TweenMax.to($landingWrapper, 2, { scrollTo: { x: "+=175" }, ease: Power2.easeOut }); } else { TweenMax.to($landingWrapper, 2, { scrollTo: { x: "-=175" }, ease: Power2.easeOut }); } }); }); //# sourceURL=pen.js </script> </body></html>

Related: See More


Questions / Comments: