I can't click the arrows or the dots. Also, hpw can I make it so that it automatically goes to the next slide? Nothing works. Any help would greatly be appreciated. Thanks!
Heres my code:
<div id="myCarousel" class="carousel slide">
<!-- 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>
<div class="carousel-inner">
<div class="item active">
<img src="img/Carousel0.png" class="img-responsive">
<div class="container">
<div class="carousel-caption">
<h1>Bootstrap 3 Carousel Layout</h1>
<pthis is="" an="" example="" layout="" with="" carousel="" that="" uses="" the="" bootstrap="" 3="" styles.<="" small=""><p></p>
<p><a class="btn btn-lg btn-primary" href="http://getbootstrap.com">Learn More</a>
</p></pthis></div>
</div>
</div>
<div class="item">
<img src="img/Carousel1.png" class="img-responsive">
<div class="container">
<div class="carousel-caption">
<h1>Changes to the Grid</h1>
<p>Bootstrap 3 still features a 12-column grid, but many of the CSS class names have completely changed.</p>
<p><a class="btn btn-large btn-primary" href="#">Learn more</a></p>
</div>
</div>
</div>
<div class="item">
<img src="img/Carousel2.png" class="img-responsive">
<div class="container">
<div class="carousel-caption">
<h1>Percentage-based sizing</h1>
<p>With "mobile-first" there is now only one percentage-based grid.</p>
<p><a class="btn btn-large btn-primary" href="#">Browse gallery</a></p>
</div>
</div>
</div>
<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>
You have your navigation inside of the carousel-inner div. Moving the closing div above the navigation should resolve your issue.
<div id="myCarousel" class="carousel slide">
<!-- 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>
<div class="carousel-inner">
<div class="item active">
<img src="img/Carousel0.png" class="img-responsive">
<div class="container">
<div class="carousel-caption">
<h1>Bootstrap 3 Carousel Layout</h1>
<pthis is="" an="" example="" layout="" with="" carousel="" that="" uses="" the="" bootstrap="" 3="" styles.<="" small=""><p></p>
<p><a class="btn btn-lg btn-primary" href="http://getbootstrap.com">Learn More</a>
</p></pthis></div>
</div>
</div>
<div class="item">
<img src="img/Carousel1.png" class="img-responsive">
<div class="container">
<div class="carousel-caption">
<h1>Changes to the Grid</h1>
<p>Bootstrap 3 still features a 12-column grid, but many of the CSS class names have completely changed.</p>
<p><a class="btn btn-large btn-primary" href="#">Learn more</a></p>
</div>
</div>
</div>
<div class="item">
<img src="img/Carousel2.png" class="img-responsive">
<div class="container">
<div class="carousel-caption">
<h1>Percentage-based sizing</h1>
<p>With "mobile-first" there is now only one percentage-based grid.</p>
<p><a class="btn btn-large btn-primary" href="#">Browse gallery</a></p>
</div>
</div>
</div>
</div>
<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>
Bootply
Related
I have a website that uses bootstrap, I have a issue with carousel indicator the Know more button on the captain not working on most screens specifically a big screen.
My code:
<section class="slider_section">
<div id="myCarousel" class="carousel slide banner-main" data-ride="carousel">
<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="carousel-item active">
<img class="first-slide" src="images/image1.png" alt="First slide">
<div class="container ">
<div class="carousel-caption relative d-block">
<h1><br><strong class="cur">Person 1</strong></h1>
<p>Admin</p>
<div class="button_section"> <a class="main_bt" href="person1.html">Know More</a></div>
</div>
</div>
</div>
<div class="carousel-item">
<img class="first-slide" src="images/image2.png" alt="First slide">
<div class="container">
<div class="carousel-caption relative d-block">
<h1><br><strong class="cur"> Person 2</strong></h1>
<p> User</p>
<div class="button_section"> <a class="main_bt" href="person2.html">Know More</a></div>
</div>
</div>
</div>
<a class="carousel-control-prev" href="#myCarousel" role="button" data-slide="prev" style="width: 5%;">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#myCarousel" role="button" data-slide="next" style="width: 5%;">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
</div>
</section>
What is the issue and how do you solve it??
(new to this)
I'm trying to get a static image with a carousel of different text going across the top. I've tried using the Bootstrap carousel HTML and removing sections (such as the multiple images), and using the "carousel-caption" class for my text, but that will take some styling to get it centered etc. This might be the best way, but if there is a simpler way, please let me know! (its in a jumbotron div as i was using a picture from my jumbotron section for ease)
TIA
<div class="jumbotron" id="testimonials">
<div class="container">
<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>
<li data-target="#carousel-example-generic" data-slide-to="2"></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<div class="item active">
<div class="carousel-text">
<h3>Example headline</h3>
<p>Example description</p>
</div>
<!-- <img src="img/lesson8-portfolioheroimage2.jpg" alt="..."> -->
</div>
<div class="item">
<!-- <img src="img/portfolioheroimage.jpg" alt="..."> -->
<div class="carousel-text">
<h3>Example head</h3>
<p>Example description</p>
</div>
</div>
<div class="item">
<!-- <img src="img/portfolioheroimage3.jpg" alt="..."> -->
<div class="carousel-text">
<h3>Example headline</h3>
<p>Example descri</p>
</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>
<span class="sr-only">Previous</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>
<span class="sr-only">Next</span>
</a>
</div>
</div><!-- container -->
</div><!-- jumbotron -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<div class="jumbotron">
<div class="container">
<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">
<div class="item active">
<div class="carousel-text">
<h3>Example headline</h3>
<p>Example description</p>
</div>
<!-- <img src="img/lesson8-portfolioheroimage2.jpg" alt="..."> -->
</div>
<div class="item">
<!-- <img src="img/portfolioheroimage.jpg" alt="..."> -->
<div class="carousel-text">
<h3>Example head</h3>
<p>Example description</p>
</div>
</div>
<div class="item">
<!-- <img src="img/portfolioheroimage3.jpg" alt="..."> -->
<div class="carousel-text">
<h3>Example headline</h3>
<p>Example descri</p>
</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>
You need something like this I guess?
You can beautify it as per your requirement.
I have made a Carousel with Bootstrap with 5 images but when I click the Next button to go through the slides its fine until on the third click it freezes and never makes it to the fourth slide, i'd be grateful for any solution so the Next button works for all slides, heres my code-
<div class="container">
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
<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>
<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>
</ol>
<div class="carousel-inner">
<div class="item active">
<img src="images2/MindBodyPilatesLogo1Carousel.png" alt="logo">
<div class="carousel-caption">
<h3>Caption Text</h3>
</div>
</div>
<div class="item">
<img src="images2/Voucher3Carousel.png" alt="...">
<div class="carousel-caption">
<h3>Caption Text</h3>
</div>
</div>
<div class="item">
<img src="images2/EagleCarousel.png" alt="...">
<div class="carousel-caption">
<h3>Caption Text</h3>
</div>
</div>
<div class="item">
<img src="images2/RestCarousel.png" alt="...">
<div class="carousel-caption">
<h3>Caption Text</h3>
</div>
</div>
<div class="item">
<img src="images2/AndyPosterCarousel.png" alt="...">
<div class="carousel-caption">
<h3>Caption Text</h3>
</div>
</div>
<div class="item">
<img src="images/tracelarge.png" alt="...">
<div class="carousel-caption">
<h3>Caption Text</h3>
</div>
</div>
</div>
<a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left"></span>
</a>
<a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right"></span>
</a>
</div>
</div>
</div>
I have written the following code for carousel. First problem faced that I could not find the slide class with carousel, kindly tell me where it occur.Second, it shows First image properly, but no sliding occur after that. In last sliding glyphicons are also not working.
<div class="row" id="carosal-row">
<div id="carousal" class="carousel slide col-md-offset-3 col-md-9" data-ride="carousel" data-interval="3000" data-wrap="true" data-pause="hover">
<ol class="carousel-indicators">
<li data-target="#carousel" data-slide-to="0" class="active"></li>
<li data-target="#carousel" data-slide-to="1"></li>
<li data-target="#carousel" data-slide-to="2"></li>
<li data-target="#carousel" data-slide-to="3"></li>
</ol>
<div class="carousel-inner" role="listbox">
<div class="item active">
<img src="images/dog1.jpg" alt="Doggy" />
<div class="carousel-caption">
...
</div>
</div>
<div class="item">
<img src="images/cat.jpg" alt="caty" />
<div class="carousel-caption">
...
</div>
</div>
<div class="item">
<img src="images/parrots.jpg" alt="caty" />
<div class="carousel-caption">
...
</div>
</div>
<div class="item">
<img src="images/dog2.png" alt="caty" />
<div class="carousel-caption">
...
</div>
</div>
</div>
<a class="left carousel-control" href="#carousel" 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="#carousel" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
</div>
is my code right or i'm missing something?
wrong spelling for carousel on multiple occations. Here is a fiddle for your code which seems to work. Did you import bootstrap?
Changed the images though:
<div class="row" id="carosal-row">
<div id="carousal" class="carousel slide col-md-offset-3 col-md-9" data-ride="carousel" data-interval="3000" data-wrap="true" data-pause="hover">
<ol class="carousel-indicators">
<li data-target="#carousel" data-slide-to="0" class="active"></li>
<li data-target="#carousel" data-slide-to="1"></li>
<li data-target="#carousel" data-slide-to="2"></li>
<li data-target="#carousel" data-slide-to="3"></li>
</ol>
<div class="carousel-inner" role="listbox">
<div class="item active">
<img src="http://upload.wikimedia.org/wikipedia/commons/7/7f/Terrestrial_planets_size_comparison.png" alt="Doggy" />
<div class="carousel-caption">
...
</div>
</div>
<div class="item">
<img src="http://upload.wikimedia.org/wikipedia/commons/3/3e/1e7m_comparison_Uranus_Neptune_Sirius_B_Earth_Venus.png" alt="caty" />
<div class="carousel-caption">
...
</div>
</div>
<div class="item">
<img src="http://upload.wikimedia.org/wikipedia/commons/9/9b/Planets_everywhere_(artist%E2%80%99s_impression).jpg" alt="caty" />
<div class="carousel-caption">
...
</div>
</div>
<div class="item">
<img src="http://upload.wikimedia.org/wikipedia/commons/9/97/The_Earth_seen_from_Apollo_17.jpg" alt="caty" />
<div class="carousel-caption">
...
</div>
</div>
</div>
<a class="left carousel-control" href="#carousel" 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="#carousel" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
</div>
There was a problem with my jQuery version. i have installed jQuery v1.1.9 and bootstrap v3.3.1 don't support it. That's why slide class was also missing. Now i updated my jQuery version ti v2.1.3
the bootstrap v3.3.1 works fine with it. so problem is solved.
I have downloaded the twitter bootsrap carousel example. I noticed that when I navigate the slide nothing happens and in my view the "slide" class from the bootstrap.css version 3 is unknown.
Based on the head section below I believe I have all the necessary js and css files.
I have 2 questions. Why is the the "slide" class unknown and should the carousel be navigable straight out of the box?
<head>
<link href ="/Content/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href ="/Content/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="/Content/bootstrap/js-twitter-bootstrap/bootstrap-dropdown.js"></script>
<script data-main="/Scripts/main" src="~/Scripts/require.min.js"></script>
<script src="/Content/bootstrap/js/bootstrap.min.js"></script>
</head>
<div id="carousel-example-generic" class="carousel slide">
<!-- 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>
<!-- Wrapper for slides -->
<div class="carousel-inner">
<div class="item active">
<img src="http://placehold.it/1200x480" alt="" />
<div class="carousel-caption">
...
</div>
</div>
...
</div>
<!-- Controls -->
<a class="left carousel-control" href="#carousel-example-generic" data-slide="prev">
<span class="icon-prev"></span>
</a>
<a class="right carousel-control" href="#carousel-example-generic" data-slide="next">
<span class="icon-next"></span>
</a>
</div
Here is a working code for carousel,
<!DOCTYPE html>
<html lang="en">
<head>
<link href="../../dist/css/bootstrap.css" rel="stylesheet">
<link href="carousel.css" rel="stylesheet">
</head>
<body>
<div class="container">
<div id="myCarousel" class="carousel slide">
<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>
<div class="carousel-inner">
<div class="item active">
<img src="data:image/png;base64," data-src="holder.js/100%x500/auto/#777:#7a7a7a/text:First slide" alt="First slide">
<div class="container">
<div class="carousel-caption">
<h1>Slide 1.</h1>
<p><a class="btn btn-large btn-primary" href="#">Sign up today</a></p>
</div>
</div>
</div>
<div class="item">
<img src="data:image/png;base64," data-src="holder.js/100%x500/auto/#777:#7a7a7a/text:Second slide" alt="Second slide">
<div class="container">
<div class="carousel-caption">
<h1>Slide 2</h1>
<p><a class="btn btn-large btn-primary" href="#">Learn more</a></p>
</div>
</div>
</div>
<div class="item">
<img src="data:image/png;base64," data-src="holder.js/100%x500/auto/#777:#7a7a7a/text:Third slide" alt="Third slide">
<div class="container">
<div class="carousel-caption">
<h1>Slide 3</h1>
<p><a class="btn btn-large btn-primary" href="#">Browse gallery</a></p>
</div>
</div>
</div>
</div>
<a class="left carousel-control" href="#myCarousel" data-slide="prev"><span class="glyphicon glyphicon-chevron-left"></span></a>
<a class="right carousel-control" href="#myCarousel" data-slide="next"><span class="glyphicon glyphicon-chevron-right"></span></a>
<script src="../../assets/js/jquery.js"></script>
<script src="../../dist/js/bootstrap.min.js"></script>
<script src="../../assets/js/holder.js"></script>