Skip to content

Instantly share code, notes, and snippets.

@jeonghwan-kim
Created October 12, 2013 15:43
Show Gist options
  • Select an option

  • Save jeonghwan-kim/6951440 to your computer and use it in GitHub Desktop.

Select an option

Save jeonghwan-kim/6951440 to your computer and use it in GitHub Desktop.
slide images by using Bootstrap.
<!DOCTYPE html>
<html>
<head>
<link href="css/bootstrap.css"rel="stylesheet"media="screen">
<style type="text/css">
.foo {
margin-left: 30px;
width: 300px;
border: solid 10px #AAA;
}
img {
width: 100%;
}
</style>
<script src="http://code.jquery.com/jquery.js"></script>
<script src="js/bootstrap.min.js"></script>
<script type="text/javascript">
$(window).load(function() {
$('.carousel').carousel({
interval: 3000
});
});
</script>
</head>
<body>
<div class="foo">
<div id="myCarousel" class="carousel slide ">
<!-- Carousel items -->
<div class="carousel-inner">
<div class="active item"><img src="image1.png" /></div>
<div class="item"><img src="image2.png" /></div>
<div class="item"><img src="image3.png" /></div>
<div class="item"><img src="image4.png" /></div>
<div class="item"><img src="image5.png" /></div>
<div class="item"><img src="image6.png" /></div>
</div>
<!-- Carousel nav -->
<a class="carousel-control left" href="#myCarousel" data-slide="prev">&lsaquo;</a>
<a class="carousel-control right" href="#myCarousel" data-slide="next">&rsaquo;</a>
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment