I'am praticing and learning about bootstrap and at this moment i am trying to adding a carousel in my website.
I picked a example from Bootstrap that haves on the first DIV, the id="carouselExampleSlidesOnly", with this ID, the carousel works perfectly.
But i want to remove the "carouselExampleSlidesOnly" and change for another ID name. When i do that changing to "myCarousel", the code stop working.
I tried to add a javascript code with the ID name, but even with that, the carousel not work, and shows a static image.
<script>
$('#myCarousel').carousel({
interval: 3000,
pause: null,
})
</script>
<div id="myCarousel" class="carousel slide" data-ride="carousel" data-interval="3000" data-pause="null">
<div class="carousel-inner">
<div class="carousel-item active">
<img class="d-block w-100" src="assets/images/slide1.png" alt="First slide">
<div class="container">
<div class="slider-text">
<h2>Lorem Ipsum is simply dummy text.</h2>
<p>ndustry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer.</p>
</div>
</div>
</div>
<div class="carousel-item">
<img class="d-block w-100" src="assets/images/slide2.png" alt="Second slide">
<div class="container">
<div class="slider-text">
<h2>Lorem Ipsum is simply dummy text.</h2>
<p>ndustry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer.</p>
</div>
</div>
</div>
</div>
<a class="carousel-control-prev" href="#carouselExampleControls" 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="#carouselExampleControls" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
I believe the problem you are having is with
You are passing null as a parameter when it expects a string or boolean value, you can see this error from the console.
(Ctrl + shift + I) on Chrome
It should be