Carousel don't work - carousel

I'm just learning some HTML+CSS and today I created a carousel using Bootstrap 4. For some reason it seems not to work. It actually doesn't trigger any action when i press the buttons, neither it switches the slides automatically.
Can anyone please give me some help?
thank you in advance
Please see attached code:
<div class="row slider">
<div class="col mt-3">
<div class="carousel slide" id="slider" data-ride="carousel">
<ol class="carousel-indicators">
<li data-target="#slider" data-slide-to="0" class="active"></li>
<li data-target="#slider" data-slide-to="1"></li>
</ol>
<div class="carousel-inner">
<div class="carousel-item active">
<img src="img/segunda.jpg" alt="Slide #1" class="d-block img-fluid">
</div>
<div class="carousel-item">
<img src="img/primera.jpg" alt="Slide #2" class="d-block img-fluid">
</div>
</div>
<a href="#slider" class="carousel-control-prev" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Anterior</span>
</a>
<a href="#slider" class="carousel-control-next" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Siguiente</span>
</a>
</div>
</div>

You have to include javascript, for example:
$('.slider').carousel({
interval: 2000
})

Related

Why image in carousel are not getting displayed in spring boot application

Here is My code image are not getting displayed i have included images both in static and template. In start when i run this cod emy image get displayed but know when i run again my images are not getting displayed have a look and code and suggest why it is doing so.
<div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators">
<li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="1"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="2"></li>
</ol>
<div class="carousel-inner">
<div class="carousel-item active">
<img class="d-block w-100 " src="image1.jpg" alt="First slide">
<div class="carousel-caption d-none d-md-block">
<h5>First Image</h5>
<p>Welcome to Management Application </p>
</div>
</div>
<div class="carousel-item">
<img class="d-block w-100 " src="image2.jpg" alt="Second slide">
</div>
<div class="carousel-item">
<img class="d-block w-100 " src="image3.jpg" alt="Third slide">
</div>
</div>
<a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
</div>```

Bootstrapv4.0.0-beta - Carousel Controls not working

I cannot get the Carousel Controls to work in Bootstrap v4.0.0-beta. Kind of strange as the Indicators work properly.
Anybody with the same problem? Bellow is the code for the Carousel implementation.
Any help would be highly appreciated.
Thanks!
<div id="my-carousel" class="carousel slide carousel-fade" data-ride="carousel">
<ol class="carousel-indicators">
<li data-target="#my-carousel" data-slide-to="0" class="active"></li>
<li data-target="#my-carousel" data-slide-to="1"></li>
</ol>
<div class="carousel-inner" role="listbox">
<div class="carousel-item active">
<div class="view hm-black-light">
<!-- CONTENT -->
<div class="full-bg-img"></div>
</div>
<div class="carousel-caption overlay">
<div class="flex-center animated fadeIn">
<!-- DETAIL -->
</div>
</div>
</div>
<div class="carousel-item">
<div class="view hm-black-light">
<!-- CONTENT -->
<div class="full-bg-img"></div>
</div>
<div class="carousel-caption overlay">
<div class="flex-center animated fadeIn">
<!-- DETAIL -->
</div>
</div>
</div>
</div>
<!--Controls-->
<a class="carousel-control-prev" href="#my-carousel" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#my-carousel" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
I had the same problem here. All I did is to copy these plugins from the Bootstrap's Website. Controls are working properly now.
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>

responsive logo over carousel

this is my 1st page where logo and carousel both are in the top section of the pageI was trying to put a responsive logo over carouser from bootstrap. Logo was over the carousel but it does not shows the responsive behavior. I used the code from www.w3schools.com i think its somewhere in the carousel class in bootstrap.min.css but cant locate it. If someone has work on it plz leave the comment.
html:
<div id="myCarousel" class="carousel slide" data-ride="carousel">
<!-- 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>
<li data-target="#myCarousel" data-slide-to="2"></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<div class="overlay">
<!--<img src="images/logo.png" class="img-responsive" alt="">-->
</div>
<div class="item active">
<img src="images/1bg.jpg" alt="">
<div class="carousel-caption">
</div>
</div>
<div class="item">
<img src="images/11bg.jpg" alt="">
<div class="carousel-caption">
</div>
</div>
<div class="item">
<img src="images/111bg.jpg" alt="">
<div class="carousel-caption">
</div>
</div>
<!-- Left and right controls -->
<a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
</div>
</div>
logo is in overlay div.I want logo to be responsive
.overlay {background: url('../images/logo.png') top left no- repeat;position: absolute;top: 30px;
left: 600px;width: 100%;height: 100%;z-index: 10;pointer-events: none;}
Use percentage instead of pixel in overlay class.
For Example:
.overlay {background: url('../images/logo.png') top left no- repeat;position: absolute;top: 3%;left: 50%;width: 100%;height: 100%;z-index: 10;pointer-events: none;}
change top and left percentages value as you need.

Bootstrap 3 Carousel indicators and controls not working? Triple checked everything

Why aren't the carousel-indicators or carousel-controls working here...
<div id="#myCarousel" class="carousel slide" data-ride="carousel">
<!-- 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" role="listbox">
<div class="item active" id="slide1">
<div class="container">
<div class="carousel-caption">
<h2>Title</h2>
<p>Text...p>
<p><a class="btn btn-md btn-success" href="#" role="button">Button</a></p>
</div>
</div>
</div>
<div class="item" id="slide2">
<div class="container">
<div class="carousel-caption">
<h2>Factors Suite</h2>
<p>Enjoy a luxury stay in the Factors Suite which features furniture crafted from reclaimed timber and works by contemporary Scottish artists.</p>
<p><a class="btn btn-md btn-info" href="#" role="button">View Gallery</a></p>
</div>
</div>
</div>
</div><!-- end carousel-inner -->
<a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div><!-- end carousel -->
At the foot of my page I have:
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/docs.min.js"></script>
I have tried using bootstrap.js instead - that doesn't work. Driving me mad this because I have the Carousel example from the Bookstrap 3 website, which works when I test it, and it is identical!
This is all live at the following URL:
http://www.cairnsmorecottages.co.uk/rickwood/index.php
Hoping some bright spark will spot the glaring mistake because there clearly is one here (my conception?)! Thank you.
NJ
Why ID from DIV <div id="#myCarousel" class="carousel slide" data-ride="carousel"> include '#' character?
Remove '#' from id
EDITED AFTER COMMENTS:
Review your html div tags. You can compare your html with this:
https://jsfiddle.net/35esebmp/
check this solution, work fine for me
$(document).ready(function(e) {
$(".carousel-indicators").click(function(){
$(".carousel").carousel('prev');
})
$(".left").click(function(){
$(".carousel").carousel('prev');
})
$(".right").click(function(){
$(".carousel").carousel('next');
})
});

Bootstrap Carousel slideshow doesn't scroll through more than three slides

I can't make my slideshow automatically scroll through all of my pictures. It scrolls through three pictures, but I have six. When I click on the arrows, it scrolls through all of the pictures, but it doesn't scroll through all of the pictures automatically. It works when the site isn't live, but it doesn't work in Chrome when it is live. Here is my code..
<div id="carousel-example-generic" class="carousel-inner" 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>
<li data-target="#carousel-example-generic" data-slide-to="2"></li>
</ol>
<div class="carousel-inner">
<div class="item active">
<img src="img/landscape.jpg" alt="landscape design and installation">
<div class="carousel-caption"></div>
</div>
<div class="item">
<img src="img/patio.jpg" alt="stonework">
<div class="carousel-caption"></div>
</div>
<div class="item">
<img src="img/patio2.jpg" alt="full-service">
<div class="carousel-caption"></div>
</div>
<div class="item">
<img src="img/firepit.png" alt="Fire Pit">
<div class="carousel-caption"></div>
</div>
<div class="item">
<img src="img/deck.png" alt="deck">
<div class="carousel-caption"></div>
</div>
<div class="item">
<img src="img/gardens.png" alt="deck">
<div class="carousel-caption"></div>
</div>
</div>
<!-- Controls -->
<a class="left carousel-control" href="#carousel-example-generic" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left"></span></a>
<a class="right carousel-control" href="#carousel-example-generic" data-slide="next">
<span class="glyphicon glyphicon-chevron-right"></span></a>
</div>
</div>
You need to add more data-targets:
<li data-target="#carousel-example-generic" data-slide-to="3"></li>
<li data-target="#carousel-example-generic" data-slide-to="4"></li>
<li data-target="#carousel-example-generic" data-slide-to="5"></li>
Since you have 6 slides you need to to have 6 data targets (starting with 0)