Bootstrap-3 carousel controls on outside - html

See my bootply
I have a Bootstrap-3 carousel with 3 x DIVs showing each time. You can click right and left for next 3 x DIVs to show. But my indicators are a whole area where you can click, the grey block. Is it possible to just have the > thingie clickable?
Also, how to get the > thingie to be outside my DIV, now its overlapping with my content? Gracias!
HTML:
<div class="carousel slide" data-ride="carousel" id=
"carousel-example- generic">
<!-- Indicators -->
<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><!-- Slider Content (Wrapper for slides )-->
<div class="carousel-inner">
<div class="item active">
<div class="col-md-4 col-sm-6">
<p>
aaaaaaaaaaaaaaaaaaaa</p>
</div>
<div class="col-md-4 col-sm-6 hidden-xs">
<p>bbbbbbbbbbbbbb</p>
</div>
<div class="col-md-4 col-sm-6 hidden-sm hidden-xs">
<p>cccccccccccccc</p>
</div>
</div>
<div class="item">
<div class="col-md-4 col-sm-6">
<p>dddddddddddddd</p>
</div>
<div class="col-md-4 col-sm-6 hidden-xs">
<p>eeeeeeeeeeeeee</p>
</div>
<div class="col-md-4 col-sm-6 hidden-sm hidden-xs">
<p>ffffffffffffff</p>
</div>
</div>
</div>
</div><!-- Controls -->
<a class="left carousel-control" data-slide="prev" href=
"#carousel-example-generic"><span class=
"glyphicon glyphicon-chevron-left"></span></a> <a class=
"right carousel-control" data-slide="next" href=
"#carousel-example-generic"><span class=
"glyphicon glyphicon-chevron-right"></span></a>
CSS:
.carousel-indicators li { visibility: hidden; }
.carousel-inner .item {
font-size:10px;
color:#0404B4
}
.carousel-control {
z-index: 10;
top: 2%;
font-family: 'Helvetica Neue', Arial, sans-serif;
}

I'have updated your css.
/* CSS used here will be applied after bootstrap.css */
.carousel-indicators li { visibility: hidden; }
.carousel-inner .item {
font-size:10px;
color:#0404B4
}
.carousel-control {
z-index: 10;
top: 2%;
width: 30px; // no more gray thing
font-family: 'Helvetica Neue', Arial, sans-serif;
}
.carousel-control.left,
.carousel-control.right { background: none }
// change it according to your needs
.carousel-control.left { left: -10px; }
.carousel-control.right { right: -10px; }
Demo

Related

Bootstrap - Carousel with images centered and auto-resized in width and height based on the Div container

I am trying to implement a carousel with Bootstrap, where the images are centered and auto-resized. For example, in the JSFiddle, as you can see the first image (the vertical one) stretches the whole div, while the third image remains at the top. I would like to reproduce the behavior of the Facebook or Twitter carousel, where the images are positioned in the center and resized according to the Div where they are included. Can you help me?
<div id="myCarousel" class="carousel slide">
<!-- Indicators -->
<ul class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active">One</li>
<li data-target="#myCarousel" data-slide-to="1">Two</li>
<li data-target="#myCarousel" data-slide-to="2">Three</li>
</ul>
<!-- Inner -->
<div class="carousel-inner">
<div class="item active">
<img src="https://scontent.ffco3-1.fna.fbcdn.net/v/t1.6435-9/171147625_1208393786271117_8898528403586821491_n.jpg?_nc_cat=111&ccb=1-3&_nc_sid=730e14&_nc_ohc=dDKFCCAYB-oAX_m2xtu&_nc_ht=scontent.ffco3-1.fna&oh=aa418a1e5facad55e6e4781237602778&oe=609A1892"
class="img-responsive" />
<div class="container">
<div class="carousel-caption">
<h1>Photo 1 - Vertical</h1>
<p>Hello!</p>
</div>
</div>
</div>
<div class="item">
<img src="https://scontent.ffco3-1.fna.fbcdn.net/v/t1.6435-9/173646266_1210629629380866_4626783539462302067_n.jpg?_nc_cat=111&ccb=1-3&_nc_sid=730e14&_nc_ohc=QelU_ZVtqAcAX9wHI-l&_nc_ht=scontent.ffco3-1.fna&oh=272c997f1febf514a031aefe9cb712cb&oe=609BBCA2"
class="img-responsive" />
<div class="container">
<div class="carousel-caption">
<h1>Photo 2 - Square</h1>
<p>Hello again!</p>
</div>
</div>
</div>
<div class="item">
<img src="https://scontent.ffco3-1.fna.fbcdn.net/v/t1.6435-9/167432599_1203101340133695_8518788973824059736_n.png?_nc_cat=107&ccb=1-3&_nc_sid=730e14&_nc_ohc=CItpIApuYmgAX_zHj8t&_nc_ht=scontent.ffco3-1.fna&oh=83145492bb38c8c2148df70086382459&oe=609A928F"
class="img-responsive" />
<div class="container">
<div class="carousel-caption">
<h1>Photo 3 - Horizontal</h1>
<p>Hello again and again!</p>
</div>
</div>
</div>
</div>
<!-- Controls -->
<a class="left carousel-control" href="#myCarousel" data-slide="prev">
<span class="icon-prev"></span>
</a>
<a class="right carousel-control" href="#myCarousel" data-slide="next">
<span class="icon-next"></span>
</a>
</div>
CSS
.carousel-indicators > li, .carousel-indicators > li.active {
width: 100px;
height: 25px;
border-radius: 0;
border: solid 1px grey;
background: lightgrey;
text-indent: 0;
}
.carousel-indicators > li.active {
background: white;
}
#myCarousel {
width: 500px;
height: 500px;
}
Add this
$('#myCarousel').owlCarousel({
autoHeight:true
});
Remove Height on CSS
#myCarousel {
width: 400px;
/*height: 400px;*/ /*remove This*/
}
Updated Code
#myCarousel .img-responsive{
margin:0 auto;
max-height:400px;
}
https://jsfiddle.net/lalji1051/qnrzuhm2/
Updeted :- https://jsfiddle.net/lalji1051/xmy46z3L/1/

How to make a photo carousel with a sidebar?

I want to make a photo carousel with a sidebar next to it, kind of like a latest news area with a photo and some text. I have tried making it with the below code but the photos don't overlap each other and instead just become three photos with text.
Here's a link to the code that I based my carousel off. (codepen)
https://codepen.io/_danko/pen/mEjgzp
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<h2 class="text-center">Bootstrap carousel with sidebar</h2>
<h3 class="text-center">This feature does not exist in official Bootstrap</h3>
<div class="container">
<div class="row">
<div class="col-sm-6 col-sm-offset-1">
<div class="carousel slide" data-ride="carousel" id="carousel-example-generic">
<!-- Indicators -->
<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>
<li data-slide-to="3" data-target="#carousel-example-generic"></li>
</ol><!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<div class="item active"><img src="http://via.placeholder.com/600x400/D6BC65/fff?text=First+img"></div>
<div class="item"><img src="http://via.placeholder.com/600x400/008A84/fff?text=Second+img"></div>
<div class="item"><img src="http://via.placeholder.com/600x400/18AAA9/fff?text=Third+img"></div>
<div class="item"><img src="http://via.placeholder.com/600x400/C993A0/fff?text=Fourth+img"></div>
</div><!-- Controls -->
<a class="left carousel-control" data-slide="prev" href="#carousel-example-generic" role="button"><span aria-hidden="true" class="glyphicon glyphicon-chevron-left"></span> <span class="sr-only">Previous</span></a> <a class="right carousel-control" data-slide="next" href="#carousel-example-generic" role="button"><span aria-hidden="true" class="glyphicon glyphicon-chevron-right"></span> <span class="sr-only">Next</span></a>
</div><!-- /.carousel -->
</div><!-- /.col-sm-8 -->
<div class="col-sm-3">
<div class="result">
<p class="active-p" data-slide-to="0" data-target="#carousel-example-generic">01. This text is related to 01. slide</p>
<p data-slide-to="1" data-target="#carousel-example-generic">02. This text is related to 02. slide</p>
<p data-slide-to="2" data-target="#carousel-example-generic">03. This text is related to 03. slide</p>
<p data-slide-to="3" data-target="#carousel-example-generic">04. This text is related to 04. slide</p>
</div>
</div><!-- /.col-sm-8 -->
</div><!-- /.row -->
</div><!-- /.container -->
<div class="author">
Made with ♥ by Danko
</div>
</body>
</html>
Here's the CSS
body {
padding-top: 50px;
}
h3 {
margin-bottom: 50px;
}
.carousel {
min-height: 200px;
margin-bottom: 15px;
}
.carousel-indicators li {
box-shadow: 1px 1px 1px rgba(145, 145, 145, 0.5);
}
p {
padding: 10px;
}
.active-p {
background: #00BCD4;
color: #fff;
}
#media only screen and (min-width: 768px) {
p {
height: 50px;
cursor: pointer;
}
}
#media only screen and (min-width: 992px) {
p {
height: 68px;
}
}
#media only screen and (min-width: 1200px) {
p {
height: 85px;
line-height: 85px;
padding: 0 10px 10px 10px;
}
}
.author {
padding-bottom: 20px;
margin-top: 50px;
text-align: center;
font-size: 14px;
}
However, when put on a proper website the photos don't look like a slider.
Thanks.
the example you use is based on bootstrap and jquery
You have to add :
<link rel='stylesheet prefetch' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css'>
<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js'></script>
<script src='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js'></script>
and the javascript listener (on slid.bs.carousel)

Slide on Bootstrap 3 Carousel error

I'm working with a Bootstrap 3 carousel. Here is what I have done far, I want it to look similar to this.
Why does the slide preview from column 2 anytime I click the arrows? Is there a way to hide the preview from showing up when clicking next/previous
Anytime I click past two slides, it errors out and doesn't go back to the first slide.
<style type="text/css">
/* #information, #video {
width: 50%; //CSS styling for table tags.
} */
.linebreak {
display: none;
}
.image {
float: left!important;
}
.carousel slide {
width: 400px;
}
.text {
width: 45%!important;
float: right!important;
right: 14px!important;
/* top: 10px!important; */
margin-right: 35px!important;
/* margin-top: 20px!important; */
}
.carousel-inner {
overflow: visible;
}
.carousel img {
border-radius: 0px;
width: 140px;
margin-right: 10px;
margin-left: 80px;
}
.carousel-control active {
position: fixed;
}
.carousel {
margin-top: 40px;
}
.firstcolumn {
width: 1000px;
}
/*.video-container {
/*position:relative;
padding-bottom:315px;
padding-top:10px; /* width: 100% ;* max-width: 500px; padding-right:0px;
/*max-height:530px; overflow: auto;
border: none;
}
.video-container img {
position:absolute;
top:0;
left:0;
width:100%;
max-width: 500px;
max-height:530px;
height:100%;
margin: 0px;*/
/*}*/
</style>
<div class="firstcolumn">
<div class="row">
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6"> <!-- DIV 1 BEGIN -->
<div id="myCarousel" class="carousel slide" data-ride="carousel" data-interval="false">
<!-- 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>
</ol>
<div class="carousel-inner">
<div class="item active">
<img class="image" src="https://www.evantage-technology.com/wp-content/uploads/2015/04/product_office365.jpg" alt="Los Angeles">
<div class="text">Office 365 is the brand name Microsoft uses for a group of subscriptions that provide productivity software and related services.</div>
</div>
<div class="item">
<img class="image" src="http://office365.ecolearning.eu/img/office_icos/delve-logo.png" alt="Chicago">
<div class="text">Microsoft Office Delve is a data visualization and discovery tool that incorporates elements of social networking and machine learning with the search capability of the Microsoft Office 365 suite.</div>
</div>
<!-- <div class="item">
<img src="ny.jpg" alt="New York">
</div>
</div> -->
<!-- Left and right controls -->
<a class="left carousel-control" href="#myCarousel" data-slide="prev" style="margin-top: 50px">
<span class="glyphicon glyphicon-chevron-left"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#myCarousel" data-slide="next" style="margin-top: 50px">
<span class="glyphicon glyphicon-chevron-right"></span>
<span class="sr-only">Next</span>
</a>
</div>
</div>
</div> <!-- DIV 1 END -->
<div class="secondcolumn">
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
<center><h3>WHAT DO YOU WANT TO DO?</h3></center>
<br/>
<div class="row">
<div class="col-sm-6" align="center">.col-sm-3</div>
<div class="col-sm-6" align="center">.col-sm-6</div>
</div>
<div class="row">
<div class="col-sm-6" align="center">.col-sm-3</div>
<div class="col-sm-6" align="center">.col-sm-6</div>
</div>
</div>
</div>
</div>
</div>
If you make use of the Bootstrap Grid inside your Carousel component you can avoid using any customized CSS. You just need to structure your HTML accordingly:
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<div class="container-fluid">
<div class="row">
<div class="col-xs-12 col-md-6">
<div id="myCarousel" class="carousel slide" data-ride="carousel" data-interval="false">
<!-- 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>
</ol>
<div class="carousel-inner">
<div class="item active">
<div class="row">
<div class="col-xs-4"><img class="img-responsive" src="https://www.evantage-technology.com/wp-content/uploads/2015/04/product_office365.jpg" alt="Los Angeles"></div>
<div class="col-xs-8">Office 365 is the brand name Microsoft uses for a group of subscriptions that provide productivity software and related services.</div>
</div>
</div>
<div class="item">
<div class="row">
<div class="col-xs-2"><img class="img-responsive" src="http://office365.ecolearning.eu/img/office_icos/delve-logo.png" alt="Chicago"></div>
<div class="col-xs-10">Microsoft Office Delve is a data visualization and discovery tool that incorporates elements of social networking and machine learning with the search capability of the Microsoft Office 365 suite.</div>
</div>
</div>
</div>
<!-- Left and right controls -->
<a class="left carousel-control" href="#myCarousel" data-slide="prev"><span class="glyphicon glyphicon-chevron-left"></span><span class="sr-only">Previous</span></a>
<a class="right carousel-control" href="#myCarousel" data-slide="next"><span class="glyphicon glyphicon-chevron-right"></span><span class="sr-only">Next</span></a>
</div>
</div>
<div class="col-xs-12 col-md-6">
<h3 class="text-center">WHAT DO YOU WANT TO DO?</h3>
<div class="row">
<div class="col-sm-6 text-center">A</div>
<div class="col-sm-6 text-center">B</div>
</div>
<div class="row">
<div class="col-sm-6 text-center">C</div>
<div class="col-sm-6 text-center">D</div>
</div>
</div>
</div>
</div>
You may need to expand the snippet to view its responsive nature. I would also point out that you were using elements like <center> which were depreciated, or attributes like align="center" on your <div> elements. You should use CSS for this sort of positioning, which with respect to Bootstrap would involve applying the text-center class to the element whose contents you wish to be centered.

Bootstrap carousel doesn't work correctly

I have a Bootstrap carousel on my page and it's not working correctly. I'm displaying 6 items from my database, but I only want 3 items on first carousel page and then 3 on next. But instead, it's showing all of the items collapsed on a single page.
here is my code
<div class="row">
<div class="carousel slide" data-ride="carousel" data-interval="9000">
<div class="carousel-inner">
<div class="item active">
<ul class="thumbnails" data-bind="foreach: myMovies">
<li class="col-md-4">
<div class="fff">
<div class="thumbnail">
<img src="some image src">
</div>
<div class="caption">
<h4 data-bind="text: Movies().Title"></h4>
</div>
</div>
</li>
</ul>
</div>
</div>
<nav>
<ul class="control-box pager">
<li><a data-slide="prev" href="#myCarousel" class=""><i class="glyphicon glyphicon-chevron-left"></i></a></li>
<li><a data-slide="next" href="#myCarousel" class=""><i class="glyphicon glyphicon-chevron-right"></i></li>
</ul>
</nav>
</div>
</div>
and my css
img {
max-width: 100%;
}
.thumbnails li > .fff .caption {
background: #fff !important;
padding: 10px
}
ul.thumbnails {
margin-bottom: 0px;
}
.caption h4 {
color: #444;
text-align: center !important;
}
.caption p {
color: #999;
}
li {
list-style-type: none;
}
#caption-value {
background-color: lightgray !important;
margin-bottom: 20px;
}
#media (max-width: 767px) {
.page-header, .control-box {
text-align: center;
}
}
#media (max-width: 479px) {
.caption {
word-break: break-all;
}
}
ul.thumbnails {
padding: 0;
}
Where seems to be a problem?
ul.thumbnails {
margin-bottom: 0px;
}
.caption h4 {
color: #444;
text-align: center !important;
}
.caption p {
color: #999;
}
li {
list-style-type: none;
}
#caption-value {
background-color: lightgray !important;
margin-bottom: 20px;
}
#media (max-width: 767px) {
.page-header, .control-box {
text-align: center;
}
}
#media (max-width: 479px) {
.caption {
word-break: break-all;
}
}
ul.thumbnails {
padding: 0;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div id="myCarousel" class="carousel slide" data-ride="carousel">
<div class="carousel-inner" role="listbox">
<div class="item active">
<ul class="thumbnails" data-bind="foreach: myMovies">
<li class="col-md-4">
<div class="fff">
<div class="thumbnail">
<img src="http://placehold.it/200x50">
</div>
<div class="caption">
<h4 data-bind="text: Movies().Title"></h4>
</div>
</div>
</li>
</ul>
</div>
<div class="item">
<ul class="thumbnails" data-bind="foreach: myMovies">
<li class="col-md-4">
<div class="fff">
<div class="thumbnail">
<img src="http://placehold.it/200x50">
</div>
<div class="caption">
<h4 data-bind="text: Movies().Title"></h4>
</div>
</div>
</li>
</ul>
</div>
</div>
<nav>
<ul class="control-box pager">
<li><a data-slide="prev" href="#myCarousel" class=""><i class="glyphicon glyphicon-chevron-left"></i></a></li>
<li><a data-slide="next" href="#myCarousel" class=""><i class="glyphicon glyphicon-chevron-right"></i></li>
</ul>
</nav>
</div>

CSS Overlay on a circle image

I have a problem with CSS overlay. I'm making a website for a dog breeder and I want to make a carousel with male and female dogs. So my idea is to have 3 circular shaped images of male dogs on one slide of a carousel and 3 of female dogs on another. All of my images are 1000x1000 so they give a perfect circle on border-radius 50%.
On the overlay of the image there should be like 80% transparent background with dog's name and pedigree over the image. But my code does not work as it should so please help :)
Here's a part of my HTML for images:
<article>
<h2>Naši psi</h2>
<div id="myCarousel" class="carousel slide" data-ride="carousel">
<div class="carousel-inner">
<div class="item active kontejner">
<div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
<img class="slika_psa" src="slika_pas.jpg"/>
<div class="info">
<h3>Sass Crveni Mayestoso</h3>
</div>
</div>
<div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
<img class="slika_psa" src="slika_pas3.jpg"/>
</div>
<div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
<img class="slika_psa" src="slika_pas2.jpg"/>
</div>
<h3 class="spol">Mužjaci</h3>
</div>
<div class="item kontejner">
<div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
<img class="slika_psa" src="slika_pas.jpg"/>
</div>
<div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
<img class="slika_psa" src="slika_pas3.jpg"/>
</div>
<div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
<img class="slika_psa" src="slika_pas2.jpg"/>
</div>
<h3>Mužjaci</h3>
</div>
<br><br>
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="1"></li>
</ol>
<!-- Left and right controls -->
<a class="left carousel-control" href="#myCarousel" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#myCarousel" data-slide="next">
<span class="glyphicon glyphicon-chevron-right"></span>
<span class="sr-only">Next</span>
</a>
</div>
</article>
And part of CSS:
.kontejner {width: 90%;
margin: 25px auto;}
.slika_psa {
width: 80%;
border: 16px solid #fff;
border-radius: 50%;
background-color: #1c1c1c;
overflow: hidden;
}
.info {position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
height: 100%;
width: 100%;
visibility: hidden;
transition: .5s ease;
background-color: #008CBA;
}
.slika_psa:hover .info {visibility: visible;}
.carousel-inner {height: 100%;}
article {display: table;
width: 100%;
height: 100vh;
margin-top: 50px;
background-image: url('background..jpg');}
I can't figure it out how to make perfect circular overlay...Any help appreciated.