Open/Close Side Menu
Search
Close
Search

CAROUSEL

View Code
<div class="carousel slide" data-ride="carousel" id="carousel-example-generic" style="max-width: 800px;">
	<div class="carousel-inner">
		<div class="item active">
			<img alt="First slide" src="/Portals/0/Images/image800300slide1.png" />
		</div>
		<div class="item">
			<img alt="Second slide" src="/Portals/0/Images/image800300slide2.png" />
		</div>
		<div class="item">
			<img alt="Third slide" src="/Portals/0/Images/image800300slide3.png" />
		</div>
	</div>
	<ol class="carousel-indicators">
		<li class="active" data-slide-to="0" data-target="#carousel-example-generic"> </li>
		<li data-slide-to="1" data-target="#carousel-example-generic"> </li>
		<li data-slide-to="2" data-target="#carousel-example-generic"> </li>
	</ol>
	<a class="left carousel-control" data-slide="prev" href="#carousel-example-generic" role="button"><span class="glyphicon glyphicon-chevron-left"></span></a>
	<a class="right carousel-control" data-slide="next" href="#carousel-example-generic" role="button"> <span class="glyphicon glyphicon-chevron-right"></span></a>
</div>

Optional captions

View Code
<div class="carousel slide" data-ride="carousel" id="carousel-example-captions" style="max-width: 800px;">
	<div class="carousel-inner">
		<div class="item active">
			<img alt="" src="/Portals/0/Images/image800300slide1.png" />
			<div class="carousel-caption">
				<h3>First slide label</h3>
				<p>Nulla vitae elit libero, a pharetra augue mollis interdum.</p>
			</div>
		</div>
		<div class="item">
			<img alt="" src="/Portals/0/Images/image800300slide2.png" />
			<div class="carousel-caption">
				<h3>Second slide label</h3>
				<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
			</div>
		</div>
		<div class="item">
			<img alt="" src="/Portals/0/Images/image800300slide3.png" />
			<div class="carousel-caption">
				<h3>Third slide label</h3>
				<p>Praesent commodo cursus magna, vel scelerisque nisl consectetur.</p>
			</div>
		</div>
	</div>
	<ol class="carousel-indicators eds_style2">
		<li class="active" data-slide-to="0" data-target="#carousel-example-captions"> </li>
		<li data-slide-to="1" data-target="#carousel-example-captions"> </li>
		<li data-slide-to="2" data-target="#carousel-example-captions"> </li>
	</ol>
	<a class="left carousel-control" data-slide="prev" href="#carousel-example-captions" role="button"><span class="glyphicon glyphicon-chevron-left"></span></a>
	<a class="right carousel-control" data-slide="next" href="#carousel-example-captions" role="button"> <span class="glyphicon glyphicon-chevron-right"></span></a>
</div>

Indicators outside

View Code
<div class="carousel slide" data-ride="carousel" id="carousel-example-indicatorOutside" style="max-width: 800px;">
	<div class="carousel-inner">
		<div class="item active">
			<img alt="" src="/Portals/0/Images/image800300slide1.png" />
			<div class="carousel-caption">
				<h3>First slide label</h3>
				<p>Nulla vitae elit libero, a pharetra augue mollis interdum.</p>
			</div>
		</div>
		<div class="item">
			<img alt="" src="/Portals/0/Images/image800300slide2.png" />
			<div class="carousel-caption">
				<h3>Second slide label</h3>
				<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
			</div>
		</div>
		<div class="item">
			<img alt="" src="/Portals/0/Images/image800300slide3.png" />
			<div class="carousel-caption">
				<h3>Third slide label</h3>
				<p>Praesent commodo cursus magna, vel scelerisque nisl consectetur.</p>
			</div>
		</div>
	</div>
	<ol class="carousel-indicators eds_indicatorsOutside">
		<li class="active" data-slide-to="0" data-target="#carousel-example-indicatorOutside"> </li>
		<li data-slide-to="1" data-target="#carousel-example-indicatorOutside"> </li>
		<li data-slide-to="2" data-target="#carousel-example-indicatorOutside"> </li>
	</ol>
</div>

Custom navigation buttons

View Code
<div class="carousel slide" data-ride="carousel" id="carousel-example-eds_cNavigation" style="max-width: 800px;">
	<div class="carousel-inner">
		<div class="item active">
			<img alt="First slide" src="/Portals/0/Images/image800300slide1.png" />
		</div>
		<div class="item">
			<img alt="Second slide" src="/Portals/0/Images/image800300slide2.png" />
		</div>
		<div class="item">
			<img alt="Third slide" src="/Portals/0/Images/image800300slide3.png" />
		</div>
	</div>
	<div class="eds_cNavigation">
		<a class="eds_cLeft" data-slide="prev" href="#carousel-example-eds_cNavigation" role="button"><i class="fa fa-angle-left"></i></a>
		<a class="eds_cRight" data-slide="next" href="#carousel-example-eds_cNavigation" role="button"><i class="fa fa-angle-right"></i></a>
	</div>
</div>

Vertical middle outside navigation position

View Code
<div class="carousel slide" data-ride="carousel" id="carousel-example-eds_cNavigationVerticalMiddleOutside" style="max-width: 800px;">
	<div class="carousel-inner">
		<div class="item active">
			<img alt="First slide" src="/Portals/0/Images/image800300slide1.png" />
		</div>
		<div class="item">
			<img alt="Second slide" src="/Portals/0/Images/image800300slide2.png" />
		</div>
		<div class="item">
			<img alt="Third slide" src="/Portals/0/Images/image800300slide3.png" />
		</div>
	</div>
	<div class="eds_cNavigation eds_verticalMiddleOutside">
		<a class="eds_cLeft" data-slide="prev" href="#carousel-example-eds_cNavigationVerticalMiddleOutside" role="button"><i class="fa fa-angle-left"></i></a>
		<a class="eds_cRight" data-slide="next" href="#carousel-example-eds_cNavigationVerticalMiddleOutside" role="button"><i class="fa fa-angle-right"></i></a>
	</div>
</div>

Vertical middle inside navigation position

View Code
<div class="carousel slide" data-ride="carousel" id="carousel-example-eds_cNavigationVerticalMiddleInside" style="max-width: 800px;">
	<div class="carousel-inner">
		<div class="item active">
			<img alt="First slide" src="/Portals/0/Images/image800300slide1.png" />
		</div>
		<div class="item">
			<img alt="Second slide" src="/Portals/0/Images/image800300slide2.png" />
		</div>
		<div class="item">
			<img alt="Third slide" src="/Portals/0/Images/image800300slide3.png" />
		</div>
	</div>
	<div class="eds_cNavigation eds_verticalMiddleInside">
		<a class="eds_cLeft" data-slide="prev" href="#carousel-example-eds_cNavigationVerticalMiddleInside" role="button"><i class="fa fa-angle-left"></i></a>
		<a class="eds_cRight" data-slide="next" href="#carousel-example-eds_cNavigationVerticalMiddleInside" role="button"><i class="fa fa-angle-right"></i></a>
	</div>
</div>

Style 2 navigation buttons

View Code
<div class="carousel slide" data-ride="carousel" id="carousel-example-eds_cNavigationStyle2" style="max-width: 800px;">
	<div class="carousel-inner">
		<div class="item active">
			<img alt="First slide" src="/Portals/0/Images/image800300slide1.png" />
		</div>
		<div class="item">
			<img alt="Second slide" src="/Portals/0/Images/image800300slide2.png" />
		</div>
		<div class="item">
			<img alt="Third slide" src="/Portals/0/Images/image800300slide3.png" />
		</div>
	</div>
	<div class="eds_cNavigation eds_verticalMiddleInside eds_style2">
		<a class="eds_cLeft" data-slide="prev" href="#carousel-example-eds_cNavigationStyle2" role="button"><i class="fa fa-angle-left"></i></a>
		<a class="eds_cRight" data-slide="next" href="#carousel-example-eds_cNavigationStyle2" role="button"><i class="fa fa-angle-right"></i></a>
	</div>
</div>

Style 3 navigation buttons

View Code
<div class="carousel slide" data-ride="carousel" id="carousel-example-eds_cNavigationStyle3" style="max-width: 800px;">
	<div class="carousel-inner">
		<div class="item active">
			<img alt="First slide" src="/Portals/0/Images/image800300slide1.png" />
		</div>
		<div class="item">
			<img alt="Second slide" src="/Portals/0/Images/image800300slide2.png" />
		</div>
		<div class="item">
			<img alt="Third slide" src="/Portals/0/Images/image800300slide3.png" />
		</div>
	</div>
	<div class="eds_cNavigation eds_style3">
		<a class="eds_cLeft" data-slide="prev" href="#carousel-example-eds_cNavigationStyle3" role="button"><i class="fa  fa-angle-double-left"></i></a>
		<a class="eds_cRight" data-slide="next" href="#carousel-example-eds_cNavigationStyle3" role="button"><i class="fa fa-angle-double-right"></i></a>
	</div>
</div>

Usage

Multiple carousels

Carousels require the use of an id on the outermost container (the .carousel) for carousel controls to function properly. When adding multiple carousels, or when changing a carousel's id, be sure to update the relevant controls.

Via data attributes

Use data attributes to easily control the position of the carousel. data-slide accepts the keywords prev or next, which alters the slide position relative to its current position. Alternatively, use data-slide-to to pass a raw slide index to the carousel data-slide-to="2", which shifts the slide position to a particular index beginning with 0.

The data-ride="carousel" attribute is used to mark a carousel as animating starting at page load. It cannot be used in combination with (redundant and unnecessary) explicit JavaScript initialization of the same carousel.

Via JavaScript

Call carousel manually with:

$('.carousel').carousel()

Options

Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-, as in data-interval="".

Name type default description
interval number 5000 The amount of time to delay between automatically cycling an item. If false, carousel will not automatically cycle.
pause string "hover" Pauses the cycling of the carousel on mouseenter and resumes the cycling of the carousel on mouseleave.
wrap boolean true Whether the carousel should cycle continuously or have hard stops.

Methods

.carousel(options)

Initializes the carousel with an optional options object and starts cycling through items.

$('.carousel').carousel({
  interval: 2000
})
.carousel('cycle')

Cycles through the carousel items from left to right.

.carousel('pause')

Stops the carousel from cycling through items.

.carousel(number)

Cycles the carousel to a particular frame (0 based, similar to an array).

.carousel('prev')

Cycles to the previous item.

.carousel('next')

Cycles to the next item.

Events

Bootstrap's carousel class exposes two events for hooking into carousel functionality.

Both events have the following additional properties:

  • direction: The direction in which the carousel is sliding (either "left" or "right").
  • relatedTarget: The DOM element that is being slid into place as the active item.
Event Type Description
slide.bs.carousel This event fires immediately when the slide instance method is invoked.
slid.bs.carousel This event is fired when the carousel has completed its slide transition.
$('#myCarousel').on('slide.bs.carousel', function () {
  // do something…
})
Back To Top