"Fullscreen carousel, controls inside container"
Bootstrap 3.0.0 Snippet by asanti82

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<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 ---------->
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
<li data-target="#carousel-example-generic" data-slide-to="1"></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<div class="item active" style="background-image:url('http://placehold.it/1024x300');">
<div class="custom-caption">
Hello..Slide 1
</div>
</div>
<div class="item" style="background-image:url('http://placehold.it/1024x300');">
<div class="custom-caption">
Slide 2
</div>
</div>
</div>
<!-- Controls -->
<a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
</a>
<a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
</a>
</div>
<div class="container" id="main">
<h1>This Content is inside the container</h1>
</div>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#main{
background:#000;
color:#fff;
}
.carousel{
height:300px;
}
.carousel .item{
height:300px;
background-size:cover;
background-repeat:no-repeat;
background-position:center;
}
.carousel .item .custom-caption{
width:60%;
margin:0 auto;
text-align:center;
padding:10% 0;
font-size:30px;
color:#fff;
font-weight:600;
}
.carousel .carousel-control.left,
.carousel .carousel-control.right,
.carousel .carousel-control.left:hover,
.carousel .carousel-control.right:hover{
background:none;
}
.carousel .carousel-control{
width: 20px;
height:20px;
top:50%;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
jQuery(function($){
var demo = {
init : function(){
this.carouselControls();
$(window).resize(function(){ demo.carouselControls(); });
},
carouselControls : function(){
var $container = $('#main');
var $slider = $('#carousel-example-generic');
var padding = 15;
var rt = ($(window).width() - ($container.offset().left + $container.outerWidth()));
$slider.find('.right.carousel-control').css('right', rt + padding).show();
$slider.find('.left.carousel-control').css('left', rt + padding).show();
}
};
demo.init();
});
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments: