Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

Bootstrap Carousel not working in PHP dynamic page

Was trying to create a Carousel using Bootstrap in my PHP file but was not able to get it to slide while the exact same code is working in a static HTML file

<div id="myCarousel" class="carousel slide jumbotron"> <div class="container"> <ol class="carousel-indicators"> <li class="active" data-target="#myCarousel" data-slide-to="0"></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"> <h1>Self-destructing message app</h1> <p class="lead">Learn how to build this fun little app by signing up for a Treehouse account today.</p> <p class="btn-group"> <a class="btn btn-success btn-lg" href="#">Download the app</a> <a class="btn btn-default btn-lg hidden-xs" href="#" >Text me the link</a> </p> </div> <div class="item"> <h1>Learn how to build it for iOS</h1> <p class="lead">We'll teach you how to build it from scratch!</p> <p> <a class="btn btn-success btn-lg" href="#">Get started today!</a> </p> </div> <div class="item"> <h1>Learn how to build it for Android</h1> <p class="lead">We'll teach you how to build it from scratch!</p> <p> <a class="btn btn-success btn-lg" href="#">Get started today!</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>

2 Answers

Can you inspect your sources and see if the site loads bootstrap.js or bootstrap.min.js? My guess is you didn't enqueue the js correctly.

Thanks alot! The files were not in the proper js folder. Now this is resolved.

Can you inspect your sources and see if the site loads bootstrap.js or bootstrap.min.js? My guess is you didn't enqueue the js correctly.