Please help with this code.
I have three items and I want when I press next or previous it passes to an another item but it didn't work it stays fixed at the item 1. I already compared my code with many other codes and it seems to me right.
It's a simple carousel with two buttons next and previous but nothing happened when I press them
'''
<div id="featured-products-carousel" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators">
<li data-target= "#featured-products-carousel" data-slide-to="0" class="active" ></li>
<li data-target= "#featured-products-carousel" data-slide-to="1" ></li>
<li data-target= "#featured-products-carousel" data-slide-to="2"></li>
</ol>
<div class="carousel-inner">
<div class="carousel-item active image-container">
<div class="carousel-placeholder ">
</div>
<div class="container">
<div class="carousel-caption text-left">
<h2>Product 1.</h2>
<p>Your product description here.</p>
<p>
<a class="btn btn-lg btn-primary" href="#service-1" role="button">
Learn more..
</a>
</p>
</div>
</div>
</div>
<!--item-->
<div class="carousel-item ">
<div class="carousel-placeholder ">
</div>
<div class="container">
<div class="carousel-caption">
<h2>Product 2.</h2>
<p>Your product description here.</p>
<p>
<a class="btn btn-lg btn-primary" href="#service-2" role="button">
learn more..
</a>
</p>
</div>
</div>
</div>
<!--item-->
<div class="carousel-item ">
<div class="carousel-placeholder">
</div>
<div class="container">
<div class="carousel-caption text-right">
<h2>Product 3.</h2>
<p>Your product description here.</p>
<p>
<a class="btn btn-lg btn-primary" href="#service-3" role="button">
Learn more..
</a>
</p>
</div>
</div>
</div>
<!--item-->
<a class="carousel-control-prev" href="#featured-products-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="#featured-products-carousel" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true">
</span>
<span class="sr-only">Next</span>
</a>
</div>
<!--carousel-->
'''
[![enter image description here][1]][1]
I'm guessing you are using Bootstrap version 5?
If so, a few things to check:
In the Bootstrap carousel example, the carousel uses data-bs-slide-to = "1" on the next button your one is data-slide-to="1", it's missing the 'bs' and that's the same with data-bs-ride and data-ride.
Check you correctly included the necessary Bootstrap JS file
Related
I'm currently studying Bootstrap 4 and was creating a Bootstrap 4 template for my personal study. However, the following code creates a left to right scrollbar on the website when you look at in the browser.
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Practice</title>
<meta name="viewport" content="wdith-device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap#4.5.3/dist/css/bootstrap.min.css" integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="bootstrap.css">
<style>
.Box{padding: 60px 10px; background: #ddd}
.Box:nth-child(even){background: #eee;}
h1, h2{margin: 30px 0;}
.container-fluid, .container{max-width:1400px;}
.carousel-indicators li {width: 10px; height: 10px; border-radius: 100%;}
/* .navbar-brand{position: relative;}
.custom-nav{position: absolute;}*/
</style>
</head>
<body>
<!-- MODAL POPUP -->
<div class="modal fade" id="modalExample">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h2 class="modal-title"> Modal Title </h2>
<button class="close" type="button" data-dismiss="modal">X</button>
</div>
<div class="modal-body">
<p>"Begin today!" That's all the note said. There was no indication from where it came or who may have written it. Had it been meant for someone else? Meghan looked around the room, but nobody made eye contact back. For a brief moment, she thought it might be a message for her to follow her dreams, but ultimately decided it was easier to ignore it as she crumpled it up and threw it away.</p>
</div>
</div> <!-- end .modal-content -->
</div> <!-- end .modal-dialog -->
</div> <!-- end .modal -->
<!-- MODAL END-->
<nav class="navbar navbar-expand-lg navbar-light bg-light row">
<a class="navbar-brand col-1 border border-primary" href="#">Navbar</a>
<button class="navbar-toggler " type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse col-11 custom-nav border border-primary" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item"><a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a></li>
<li class="nav-item"><a class="nav-link" href="#">Tab 1</a></li>
<li class="nav-item dropdown"><a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dropdown Tab</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#">Something else here</a>
</div></li>
<li class="nav-item"><a class="nav-link" href="#" tabindex="-1" aria-disabled="true">Tab 2</a></li>
</ul>
<form class="form-inline my-2 my-lg-0">
<input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search">
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
</form>
</div>
</nav>
<div class="container">
<div class="carousel slide" id="ExampleSlide" data-ride="carousel" data-interval="1000">
<ol class="carousel-indicators">
<li data-target="#ExampleSlide" data-slide-to="0" class="active"></li>
<li data-target="#ExampleSlide" data-slide-to="1"></li>
<li data-target="#ExampleSlide" data-slide-to="2"></li>
</ol>
<div class="carousel-inner">
<div class="carousel-item active">
<img class="w-100" src="1.png">
<div class="carousel-caption"><h5>Image 1</h5></div>
</div>
<div class="carousel-item">
<img class="w-100" src="2.png">
<div class="carousel-caption"><h5>Image 2</h5></div>
</div>
<div class="carousel-item">
<img class="w-100" src="3.png">
<div class="carousel-caption"><h5>Image 3</h5></div>
</div>
</div>
<a class="carousel-control-prev"href="#ExampleSlide" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
</a>
<a class="carousel-control-next"href="#ExampleSlide" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
</a>
</div>
</div>
<div class="jumbotron jumbotron-fluid row">
<div class="offset-1 col-10">
<h1 class="display-1">Heading 1</h1>
<p class="h1">"Begin today!" That's all the note said. There was no indication from where it came or who may have written it. Had it been meant for someone else? Meghan looked around the room, but nobody made eye contact back. For a brief moment, she thought it might be a message for her to follow her dreams, but ultimately decided it was easier to ignore it as she crumpled it up and threw it away.</p>
<p class="lead">Stranded. Yes, she was now the first person ever to land on Venus, but that was of little consequence. Her name would be read by millions in school as the first to land here, but that celebrity would never actually be seen by her. She looked at the control panel and knew there was nothing that would ever get it back into working order. She was the first and it was not clear this would also be her last.</p>
</div>
</div>
<div class='container'>
<!-- ACCORDION -->
<div class="card-group" id="exampleAccordion">
<div class="card">
<div class="card-header text-white bg-primary">
<h3 class="card-title" data-target="#card-1" data-toggle="collapse">Accordion Example 1</h3>
</div>
<div class="collapse" id="card-1">
<div class="card-body">
<p>"Begin today!" That's all the note said. There was no indication from where it came or who may have written it. Had it been meant for someone else? Meghan looked around the room, but nobody made eye contact back. For a brief moment, she thought it might be a message for her to follow her dreams, but ultimately decided it was easier to ignore it as she crumpled it up and threw it away.</p>
</div>
</div>
</div>
</div>
<!-- ACCORDION END -->
<!-- Accordion은 기본적으로 열리고 닫히는 dropdown과 비슷한 기능을 가진 element라고 보면 된다. -->
<!-- Accordion은 collapse를 사용하여 만든다. -->
<div class="card-deck">
<div class="card">
<div class="card-header text-white bg-primary">
<h1>Heading 1</h1>
</div>
<div class="card-body">
<p>"Begin today!" That's all the note said. There was no indication from where it came or who may have written it. Had it been meant for someone else? Meghan looked around the room, but nobody made eye contact back. For a brief moment, she thought it might be a message for her to follow her dreams, but ultimately decided it was easier to ignore it as she crumpled it up and threw it away.</p>
<p>Stranded. Yes, she was now the first person ever to land on Venus, but that was of little consequence. Her name would be read by millions in school as the first to land here, but that celebrity would never actually be seen by her. She looked at the control panel and knew there was nothing that would ever get it back into working order. She was the first and it was not clear this would also be her last.</p>
</div>
<div class="card-footer">
<p>More Info</p>
</div>
</div>
<div class="card">
<div class="card-header text-white bg-danger">
<h1>Heading 1</h1>
</div>
<div class="card-body">
<p>"Begin today!" That's all the note said. There was no indication from where it came or who may have written it. Had it been meant for someone else? Meghan looked around the room, but nobody made eye contact back. For a brief moment, she thought it might be a message for her to follow her dreams, but ultimately decided it was easier to ignore it as she crumpled it up and threw it away.</p>
<p>Stranded. Yes, she was now the first person ever to land on Venus, but that was of little consequence. Her name would be read by millions in school as the first to land here, but that celebrity would never actually be seen by her. She looked at the control panel and knew there was nothing that would ever get it back into working order. She was the first and it was not clear this would also be her last.</p>
</div>
<div class="card-footer">
<p><span data-toggle="modal" data-target="#modalExample">More Info</p>
</div>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap#4.5.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ho+j7jyWK8fNQe+A12Hb8AhRq26LrZ/JpcUGGOn+Y7RsweNrtN/tE3MoK7ZeZDyx" crossorigin="anonymous"></script>
<script>
$(".nav li a").on("click", function(){
$(".nav li a").removeClass("active");
$(this).addClass("active");
});
$(function () {
$('[data-toggle="tooltip"]').tooltip();
});
$('.carousel').carousel({
pause: false,
});
</script>
</body>
</html>
I can't find the reason why this might be... Does anybody know why this is happening? I want the web page to be just 100% on the screen, not having to scroll from left to right.
https://jsfiddle.net/8wvszpqa/
*edit: The scrollbar I'm meaning is one the picture below:
I am not sure about your issue but tryin to help. Remove those codes from your script to get rid of the bar.
<div class="container">
<div class="carousel slide" id="ExampleSlide" data-ride="carousel" data-interval="1000">
<ol class="carousel-indicators">
<li data-target="#ExampleSlide" data-slide-to="0" class="active"></li>
<li data-target="#ExampleSlide" data-slide-to="1"></li>
<li data-target="#ExampleSlide" data-slide-to="2"></li>
</ol>
<div class="carousel-inner">
<div class="carousel-item active">
<img class="w-100" src="1.png">
<div class="carousel-caption">
<h5>Image 1</h5>
</div>
</div>
<div class="carousel-item">
<img class="w-100" src="2.png">
<div class="carousel-caption">
<h5>Image 2</h5>
</div>
</div>
<div class="carousel-item">
<img class="w-100" src="3.png">
<div class="carousel-caption">
<h5>Image 3</h5>
</div>
</div>
</div>
<a class="carousel-control-prev" href="#ExampleSlide" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
</a>
<a class="carousel-control-next" href="#ExampleSlide" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
</a>
</div>
</div>
Sorry for the size of the links....Stackoverflow doesn't allow link shorteners...
Earlier it was working just fine. But at the time of submission, when I was checking the whole output of the site, I noticed that it wasn't working at all...
It doesn't change on its on..which it use to do earlier...
When I click on the next or the previous button, it just looks as if it was ' href="#" ', it does nothing at all...
Here is the code -
HTML
<div class='container'>
<div class='carousel slide' data-ride='carousel' id='myCarousel'>
<!-- Indicators -->
<ol class='carousel-indicators'>
<li class='active' data-slide-to='0' data-target='#myCarousel'/>
<li data-slide-to='1' data-target='#myCarousel'/>
<li data-slide-to='2' data-target='#myCarousel'/>
</ol>
<!-- Wrapper for slides -->
<div class='carousel-inner'>
<div class='item active'>
<img alt='Statue of Unity' src='https://southindia1-mediap.svc.ms/transform/thumbnail?provider=spo&inputFormat=jpg&cs=fFNQTw&docid=https://lpuin-my.sharepoint.com:443/_api/v2.0/drives/b!oY30talLiUS8rG_BEWnrXVosZvQbZtBCgL0B34hPVyiHfGeNwOpCTIXwHQY9v522/items/01QPSJLNKSLYWYT7SANNHJ7KMPQETY232Q%3Fversion%3DPublished&access_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJub25lIn0.eyJhdWQiOiIwMDAwMDAwMy0wMDAwLTBmZjEtY2UwMC0wMDAwMDAwMDAwMDAvbHB1aW4tbXkuc2hhcmVwb2ludC5jb21AZTE0ZTczZWItNTI1MS00Mzg4LThkNjctOGY5ZjJlMmQ1YTQ2IiwiaXNzIjoiMDAwMDAwMDMtMDAwMC0wZmYxLWNlMDAtMDAwMDAwMDAwMDAwIiwibmJmIjoiMTU5ODcyNjg0NSIsImV4cCI6IjE1OTg3NDg0NDUiLCJlbmRwb2ludHVybCI6Imp3Y0s0OWpDdnJhNmJGalJLTFhBZmFNWHNpMmlXZzkzZTBESWZ3Yk11bTg9IiwiZW5kcG9pbnR1cmxMZW5ndGgiOiIxMTUiLCJpc2xvb3BiYWNrIjoiVHJ1ZSIsImNpZCI6Ik9EaGtZamMwT1dZdE9EQTVPQzB3TURBd0xUUmhOV1V0WlRFMk5qWTNNMlJoT1RkaSIsInZlciI6Imhhc2hlZHByb29mdG9rZW4iLCJzaXRlaWQiOiJZalZtTkRoa1lURXROR0poT1MwME5EZzVMV0pqWVdNdE5tWmpNVEV4TmpsbFlqVmsiLCJzaWduaW5fc3RhdGUiOiJbXCJrbXNpXCJdIiwibmFtZWlkIjoiMCMuZnxtZW1iZXJzaGlwfGFtaXQuMTE4MTI2MjFAbHB1LmluIiwibmlpIjoibWljcm9zb2Z0LnNoYXJlcG9pbnQiLCJpc3VzZXIiOiJ0cnVlIiwiY2FjaGVrZXkiOiIwaC5mfG1lbWJlcnNoaXB8MTAwMzdmZmVhZTQ5YTAwMkBsaXZlLmNvbSIsInR0IjoiMCIsInVzZVBlcnNpc3RlbnRDb29raWUiOiIzIn0.Q0NOVDBRVmVZcW9PanhqdGxiaW4rM3RNY1Y0NzhXLzdyTFJyeG91Sjd5bz0&encodeFailures=1&srcWidth=&srcHeight=&width=1366&height=341&action=Access' style='width:100%;'/>
</div>
<div class='item'>
<img alt='Tea Farms Kerela' src='https://southindia1-mediap.svc.ms/transform/thumbnail?provider=spo&inputFormat=jpg&cs=fFNQTw&docid=https://lpuin-my.sharepoint.com:443/_api/v2.0/drives/b!oY30talLiUS8rG_BEWnrXVosZvQbZtBCgL0B34hPVyiHfGeNwOpCTIXwHQY9v522/items/01QPSJLNNU5JD33JBMEZG2HB4SGJUW4EFW%3Fversion%3DPublished&access_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJub25lIn0.eyJhdWQiOiIwMDAwMDAwMy0wMDAwLTBmZjEtY2UwMC0wMDAwMDAwMDAwMDAvbHB1aW4tbXkuc2hhcmVwb2ludC5jb21AZTE0ZTczZWItNTI1MS00Mzg4LThkNjctOGY5ZjJlMmQ1YTQ2IiwiaXNzIjoiMDAwMDAwMDMtMDAwMC0wZmYxLWNlMDAtMDAwMDAwMDAwMDAwIiwibmJmIjoiMTU5ODcyODk2MSIsImV4cCI6IjE1OTg3NTA1NjEiLCJlbmRwb2ludHVybCI6Imp3Y0s0OWpDdnJhNmJGalJLTFhBZmFNWHNpMmlXZzkzZTBESWZ3Yk11bTg9IiwiZW5kcG9pbnR1cmxMZW5ndGgiOiIxMTUiLCJpc2xvb3BiYWNrIjoiVHJ1ZSIsImNpZCI6Ik9HUmtaRGMwT1dZdE9UQTFNUzB3TURBd0xUVmlZamd0WWpBMU1UUm1abU01WXpnNSIsInZlciI6Imhhc2hlZHByb29mdG9rZW4iLCJzaXRlaWQiOiJZalZtTkRoa1lURXROR0poT1MwME5EZzVMV0pqWVdNdE5tWmpNVEV4TmpsbFlqVmsiLCJzaWduaW5fc3RhdGUiOiJbXCJrbXNpXCJdIiwibmFtZWlkIjoiMCMuZnxtZW1iZXJzaGlwfGFtaXQuMTE4MTI2MjFAbHB1LmluIiwibmlpIjoibWljcm9zb2Z0LnNoYXJlcG9pbnQiLCJpc3VzZXIiOiJ0cnVlIiwiY2FjaGVrZXkiOiIwaC5mfG1lbWJlcnNoaXB8MTAwMzdmZmVhZTQ5YTAwMkBsaXZlLmNvbSIsInR0IjoiMCIsInVzZVBlcnNpc3RlbnRDb29raWUiOiIzIn0.Q2tEV3NBb0dWaE01d3UvR0pRS3lyMnZVWXYyUXlxS21sYS9sMzhneVNoVT0&encodeFailures=1&srcWidth=&srcHeight=&width=1366&height=341&action=Access' style='width:100%;'/>
</div>
<div class='item'>
<img alt='Taj Mahal' src='https://southindia1-mediap.svc.ms/transform/thumbnail?provider=spo&inputFormat=jpg&cs=fFNQTw&docid=https://lpuin-my.sharepoint.com:443/_api/v2.0/drives/b!oY30talLiUS8rG_BEWn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oZ1NzVT0&encodeFailures=1&srcWidth=&srcHeight=&width=1366&height=341&action=Access' style='width:100%;'/>
</div>
</div>
<!-- Left and right controls -->
<a class='left carousel-control' data-slide='prev' href='#myCarousel'>
<span class='glyphicon glyphicon-chevron-left'/>
<span class='sr-only'>Previous</span>
</a>
<a class='right carousel-control' data-slide='next' href='#myCarousel'>
<span class='glyphicon glyphicon-chevron-right'/>
<span class='sr-only'>Next</span>
</a>
CSS -
.carousel{
background: white;
width: 100%;
}
.carousel-item{
text-align: center;
min-height: 360px;
width: 100%;
}
I made a few changes to your code.
The mistakes that were fixed are the following inside of your carousel-indicators your <li> were first closed incorrectly, therefore, you must change them from
<li class='active' data-slide-to='0' data-target='#myCarousel' />
<li data-slide-to='1' data-target='#myCarousel' />
<li data-slide-to='2' data-target='#myCarousel' />
to
<li class='active' data-slide-to='0' data-target='#myCarousel'></li>
<li data-slide-to='1' data-target='#myCarousel'></li>
<li data-slide-to='2' data-target='#myCarousel'></li>
The second mistake I noticed you made was inside carousel-inner content
you should use the class carousel-item instead of item
The third mistake was the class name of the a tag is wrong and you didn't close the span correctly.
<!-- Left and right controls -->
<a class='left carousel-control' data-slide='prev' href='#myCarousel'>
<span class='glyphicon glyphicon-chevron-left'/>
<span class='sr-only'>Previous</span>
</a>
<a class='right carousel-control' data-slide='next' href='#myCarousel'>
<span class='glyphicon glyphicon-chevron-right'/>
<span class='sr-only'>Next</span>
</a>
The a tag class names should be changed from this
<a class='right carousel-control' data-slide='next' href='#myCarousel'>
<a class='left carousel-control' data-slide='prev' href='#myCarousel'>
to this
<a class='carousel-control-prev' data-slide='prev' href='#myCarousel'>
<a class='carousel-control-next' data-slide='next' href='#myCarousel'>
you didn't close a span probably.
Your span:
<span class='glyphicon glyphicon-chevron-left'/>
<span class='glyphicon glyphicon-chevron-right'/>
They should be closed like this
<span class='glyphicon glyphicon-chevron-left'></span>
<span class='glyphicon glyphicon-chevron-right'><span>
I also noticed that you were trying to add a custom icon. you can do that by replacing
<span class='glyphicon glyphicon-chevron-right'><span>
by ( the icon bootstrap uses )
<span class="carousel-control-next-icon" aria-hidden="true"></span>
or ( custom icon from fontawesome)
<span> <i class="fas fa-arrow-circle-left" aria-hidden="true"></i></span>
Don't forget to add the fontawesome CDN in your head if you are going to use the custom icon.
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.10.0/css/all.min.css" integrity="sha512-PgQMlq+nqFLV4ylk1gwUOgm6CtIIXkKwaIHp/PAIWHzig/lKZSEGKEysh0TCVbHJXCLN7WetD8TFecIky75ZfQ==" crossorigin="anonymous" />
===
Here is your code after applying all the fixes to it.
<div class='container'>
<div class='carousel slide' data-ride='carousel' id='myCarousel'>
<!-- Indicators -->
<ol class='carousel-indicators'>
<li class='active' data-slide-to='0' data-target='#myCarousel'></li>
<li data-slide-to='1' data-target='#myCarousel'></li>
<li data-slide-to='2' data-target='#myCarousel'></li>
</ol>
<!-- Wrapper for slides -->
<div class='carousel-inner'>
<div class='carousel-item active'>
<img alt='Statue of Unity' src='https://southindia1-mediap.svc.ms/transform/thumbnail?provider=spo&inputFormat=jpg&cs=fFNQTw&docid=https://lpuin-my.sharepoint.com:443/_api/v2.0/drives/b!oY30talLiUS8rG_BEWnrXVosZvQbZtBCgL0B34hPVyiHfGeNwOpCTIXwHQY9v522/items/01QPSJLNKSLYWYT7SANNHJ7KMPQETY232Q%3Fversion%3DPublished&access_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJub25lIn0.eyJhdWQiOiIwMDAwMDAwMy0wMDAwLTBmZjEtY2UwMC0wMDAwMDAwMDAwMDAvbHB1aW4tbXkuc2hhcmVwb2ludC5jb21AZTE0ZTczZWItNTI1MS00Mzg4LThkNjctOGY5ZjJlMmQ1YTQ2IiwiaXNzIjoiMDAwMDAwMDMtMDAwMC0wZmYxLWNlMDAtMDAwMDAwMDAwMDAwIiwibmJmIjoiMTU5ODcyNjg0NSIsImV4cCI6IjE1OTg3NDg0NDUiLCJlbmRwb2ludHVybCI6Imp3Y0s0OWpDdnJhNmJGalJLTFhBZmFNWHNpMmlXZzkzZTBESWZ3Yk11bTg9IiwiZW5kcG9pbnR1cmxMZW5ndGgiOiIxMTUiLCJpc2xvb3BiYWNrIjoiVHJ1ZSIsImNpZCI6Ik9EaGtZamMwT1dZdE9EQTVPQzB3TURBd0xUUmhOV1V0WlRFMk5qWTNNMlJoT1RkaSIsInZlciI6Imhhc2hlZHByb29mdG9rZW4iLCJzaXRlaWQiOiJZalZtTkRoa1lURXROR0poT1MwME5EZzVMV0pqWVdNdE5tWmpNVEV4TmpsbFlqVmsiLCJzaWduaW5fc3RhdGUiOiJbXCJrbXNpXCJdIiwibmFtZWlkIjoiMCMuZnxtZW1iZXJzaGlwfGFtaXQuMTE4MTI2MjFAbHB1LmluIiwibmlpIjoibWljcm9zb2Z0LnNoYXJlcG9pbnQiLCJpc3VzZXIiOiJ0cnVlIiwiY2FjaGVrZXkiOiIwaC5mfG1lbWJlcnNoaXB8MTAwMzdmZmVhZTQ5YTAwMkBsaXZlLmNvbSIsInR0IjoiMCIsInVzZVBlcnNpc3RlbnRDb29raWUiOiIzIn0.Q0NOVDBRVmVZcW9PanhqdGxiaW4rM3RNY1Y0NzhXLzdyTFJyeG91Sjd5bz0&encodeFailures=1&srcWidth=&srcHeight=&width=1366&height=341&action=Access'
style='width:100%;' />
</div>
<div class='carousel-item'>
<img alt='Tea Farms Kerela' src='https://southindia1-mediap.svc.ms/transform/thumbnail?provider=spo&inputFormat=jpg&cs=fFNQTw&docid=https://lpuin-my.sharepoint.com:443/_api/v2.0/drives/b!oY30talLiUS8rG_BEWnrXVosZvQbZtBCgL0B34hPVyiHfGeNwOpCTIXwHQY9v522/items/01QPSJLNNU5JD33JBMEZG2HB4SGJUW4EFW%3Fversion%3DPublished&access_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJub25lIn0.eyJhdWQiOiIwMDAwMDAwMy0wMDAwLTBmZjEtY2UwMC0wMDAwMDAwMDAwMDAvbHB1aW4tbXkuc2hhcmVwb2ludC5jb21AZTE0ZTczZWItNTI1MS00Mzg4LThkNjctOGY5ZjJlMmQ1YTQ2IiwiaXNzIjoiMDAwMDAwMDMtMDAwMC0wZmYxLWNlMDAtMDAwMDAwMDAwMDAwIiwibmJmIjoiMTU5ODcyODk2MSIsImV4cCI6IjE1OTg3NTA1NjEiLCJlbmRwb2ludHVybCI6Imp3Y0s0OWpDdnJhNmJGalJLTFhBZmFNWHNpMmlXZzkzZTBESWZ3Yk11bTg9IiwiZW5kcG9pbnR1cmxMZW5ndGgiOiIxMTUiLCJpc2xvb3BiYWNrIjoiVHJ1ZSIsImNpZCI6Ik9HUmtaRGMwT1dZdE9UQTFNUzB3TURBd0xUVmlZamd0WWpBMU1UUm1abU01WXpnNSIsInZlciI6Imhhc2hlZHByb29mdG9rZW4iLCJzaXRlaWQiOiJZalZtTkRoa1lURXROR0poT1MwME5EZzVMV0pqWVdNdE5tWmpNVEV4TmpsbFlqVmsiLCJzaWduaW5fc3RhdGUiOiJbXCJrbXNpXCJdIiwibmFtZWlkIjoiMCMuZnxtZW1iZXJzaGlwfGFtaXQuMTE4MTI2MjFAbHB1LmluIiwibmlpIjoibWljcm9zb2Z0LnNoYXJlcG9pbnQiLCJpc3VzZXIiOiJ0cnVlIiwiY2FjaGVrZXkiOiIwaC5mfG1lbWJlcnNoaXB8MTAwMzdmZmVhZTQ5YTAwMkBsaXZlLmNvbSIsInR0IjoiMCIsInVzZVBlcnNpc3RlbnRDb29raWUiOiIzIn0.Q2tEV3NBb0dWaE01d3UvR0pRS3lyMnZVWXYyUXlxS21sYS9sMzhneVNoVT0&encodeFailures=1&srcWidth=&srcHeight=&width=1366&height=341&action=Access'
style='width:100%;' />
</div>
<div class='carousel-item'>
<img alt='Taj Mahal' src='https://southindia1-mediap.svc.ms/transform/thumbnail?provider=spo&inputFormat=jpg&cs=fFNQTw&docid=https://lpuin-my.sharepoint.com:443/_api/v2.0/drives/b!oY30talLiUS8rG_BEWnrXVosZvQbZ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&encodeFailures=1&srcWidth=&srcHeight=&width=1366&height=341&action=Access'
style='width:100%;' />
</div>
</div>
<!-- Left and right controls -->
<a class='carousel-control-prev' data-slide='prev' href='#myCarousel'>
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class='sr-only'>Previous</span>
</a>
<a class='carousel-control-next' data-slide='next' href='#myCarousel'>
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class='sr-only'>Next</span>
</a>
</div>
</div>
and here is a working example I added for you. using bootstrap 4.
<!-- CSS only -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
<div class="slider">
<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>
<li data-target="#carouselExampleIndicators" data-slide-to="3"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="4"></li>
</ol>
<div class="carousel-inner">
<div class="carousel-item active">
<img src="https://picsum.photos/1920/1080 " class="d-block w-100 vh-100" alt="pic-1">
<div class="overlay "> </div>
</div>
<div class="carousel-item">
<img src="https://picsum.photos/1920/1081" class="d-block w-100 vh-100 " alt="pic-2">
<div class="overlay "> </div>
</div>
<div class="carousel-item">
<img src="https://picsum.photos/1920/1082" class="d-block w-100 vh-100 " alt="pic-3">
<div class="overlay "> </div>
</div>
<div class="carousel-item">
<img src="https://picsum.photos/1920/1083" class="d-block w-100 vh-100 " alt="pic-4">
<div class="overlay "> </div>
</div>
<div class="carousel-item">
<img src="https://picsum.photos/1920/1084" class="d-block w-100 vh-100 " alt="pic-5">
<div class="overlay "> </div>
</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>
<!-- JS, Popper.js, and jQuery -->
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js#1.16.1/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script>
hi Every one would you help me please regarding my project I'm getting frustrating of the error it would not next when I try to click next in
edge browser the carousel would not work its button
you can view this information about the carousel that I have choosen here's the link http://v4-alpha.getbootstrap.com/components/carousel/#carouselprev
<section id ="Carousel">
<div id="carousel-home" class="carousel slide"data-ride="carousel">
<ol class="carousel-indicators">
<li data-target="#carousel-home" data-slide-to="0" class="active"></li>
<li data-target="#carousel-home" data-slide-to="1"></li>
<li data-target="#carousel-home" data-slide-to="2"></li>
</ol>
<div class="carousel-inner">
<div class="carousel-item active">
<img class="d-block img-fluid" src="girl_holdCamera.jpg" alt="woman holding a cannon camera">
<div class = "carousel-caption">
<h3>A woman holding camera</h3>
<p>she is probably holding a cannon camera to take picture</p>
</div>
</div>
<div class="carousel-item">
<img class="d-block img-fluid" src="heart.jpg" alt="heart forming by thiere hand">
<div class = "carousel-caption">
<h3>Building a heart with Two hands</h3>
<p>they build a heart with the use of thiere hands to keep them promesis</p>
</div>
</div>
<div class="carousel-item">
<img class="d-block img-fluid" src="Smart-guy-holding-beautiful-girl-in-arms.jpg" alt="guy holding girl in his hand">
<div class = "carousel-caption">
<h3>Guy and Pretty woman hugging for the First time</h3>
<p> They were happy to meet each of them</p>
</div>
</div>
</div>
<a class="carousel-control-prev" href="#carousel-home" 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="#carousel-home" role="button" data-slide= "next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
</section>
<!-- jQuery first, then Bootstrap JS. -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="js/bootstrap.min.js"></script>
I'm very new to web coding and i need to make background slide show.
But with slideshow code my main navigation disappears. Heare is my code with slide show and image how it looks.
link to photo with slideshow
<div class="bgded overlay";>
<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" role="listbox" class="bgded overlay">
<!-- Slide One - Set the background image for this slide in the line below -->
<div class="carousel-item active" style="background-image: url('woodtrails2en.png')">
<div class="carousel-caption d-none d-md-block" class="bgded overlay">
</div>
</div>
<!-- Slide Two - Set the background image for this slide in the line below -->
<div class="carousel-item" style="background-image: url('wall4.png')">
<div class="carousel-caption d-none d-md-block">
</div>
</div>
<!-- Slide Three - Set the background image for this slide in the line below -->
<div class="carousel-item" style="background-image: url('wall2.jpg')">
<div class="carousel-caption d-none d-md-block">
</div>
</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 id="logo" class="fl_left">
<h1><img src="woodluck_EN.png"> <img src="ms.png"></h1>
</div>
<nav id="mainav" class="fl_right">
<ul class="clear">
<li>Home</li>
<li>Gallery</li>
<li>Contact</li>
<div class="flag" id="flags">
<li>LT</li>
<li>EN</li>
</div>
</ul>
</div>
</nav>
<!-- ################################################################################################ -->
</header>
and here is code without slideshow
link of photo without slideshow
<!-- Top Background Image Wrapper -->
<h1><img src="woodluck_EN.png"> <img src="ms.png"></h1>
</div>
<nav id="mainav" class="fl_right">
<ul class="clear">
<li>Home</li>
<li>Gallery</li>
<li>Contact</li>
<div class="flag" id="flags">
<li>LT</li>
<li>EN</li>
</div>
</ul>
</nav>
So my main mav disapears, without slideshow everything goes well. Please help guy! Thanks!
I highly suggest using Flickity it is an open source slider all you have to do is download the CSS and JS for it and add them to your files. Then use predefined classes with them. For example...
<div id="slider">
<div class="main-carousel">
<div class="carousel-cell">
<li><img src="#"/></li>
</div>
</div>
</div>
<div id="home-slider" class="carousel slide" data-ride="carousel" data-
interval="5000">
<div class="carousel-inner">
<div class="item active" style="background-image: url(images/slider/1.jpg)">
<div class="caption">
<h1 class="animated fadeInLeftBig">Na mieru <span>pre Vás</span></h1>
<p class="animated fadeInRightBig">Každá naša sauna je originál vyrábaný
na mieru pre Vás, podľa Vašich požiadaviek.</p>
<a data-scroll class="btn btn-start bttn-stt animated fadeInUpBig" data-
scroll-time = 1.25 href="#form_description">Cenová ponuka</a>
</div>
</div>
<div class="item" style="background-image: url(images/slider/2.jpg)">
<div class="caption">
<h1 class="animated fadeInLeftBig">Kvalitné <span>vyhotovenie </span>
</h1>
<p class="animated fadeInRightBig">Precízne remeselné spracovanie a
používanie kvalitných materiálov je pre nás otázkou hrdosti</p>
<a data-scroll class="btn btn-start scrol-btn animated fadeInUpBig"
data-scroll-time = 1.25 href="#gallery">Galéria</a>
</div>
</div>
<div class="item" style="background-image: url(images/slider/3.jpg)">
<div class="caption">
<h1 class="animated fadeInLeftBig">SKUTOČNE <span>PRÍRODNÉ</span></h1>
<p class="animated fadeInRightBig">Ponúkame Vám sauny bez chémie -
žiadne lepidlá, chemické nátery a iné škodlivé látky, ktoré by sa pri
vysokých teplotách mohli uvoľňovať.</p>
<a data-scroll class="btn btn-start animated fadeInUpBig"
href="#product" data-scroll-time = 1.25>Prečo EKO?</a>
</div>
</div>
</div>
<a class="left-control" href="#home-slider" data-slide="prev"><i
class="fa fa-angle-left"></i></a>
<a class="right-control" href="#home-slider" data-slide="next"><i
class="fa fa-angle-right"></i></a>
</div>
I want to keep my carousel and nav bar in the middle 75% of the screen so i laid my screen out with a grid. I cant recreate it on fiddle but if you put it into you local you'll see; screenshot: see 'block 4' on top of the pic, thats where the col starts
<div class="col-sm-3">col1 </div>
<div class="col-xs-12 col-sm-6"> Carousel goes here </div>
<div class="col-sm-3">col3 </div>
The problem is that my images overflow onto the 3rd col, how can i get the carousel to stay in my middle cell/col?
full code below
<body>
<!--rows and cols structure -->
<div class="row">
<div class="col-sm-3">block1 </div>
<div class="col-xs-12 col-sm-6">
<!--carouselstart-->
<div class="container page-content">
<div class="hero row">
<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">
<img src="img/image1.jpg" alt="image 1 missing" title="Image 1">
<div class="carousel-caption">
<h3>caption1</h3>
</div>
</div>
<div class="item">
<img src="img/image2.jpg" alt="image 2 missing" title="Image 2">
<div class="carousel-caption">
<h3>caption 2</h3>
</div>
</div>
<div class="item">
<img src="img/image3.jpg" alt="image 3 missing" title="Image 3">
<div class="carousel-caption">
<h3>caption 2</h3>
</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> <!--end hero -->
</div><!--end of container-->
<!--nav bar goes here-->
<div class="col-sm-3">block4</div>
UPDATE....
I used thr chrome dev tools to alter some css and found that if i set the below to 100% then it fits perfectectly. How do i do this ?