Bootstrap: Adding a Slideshow (Carousel)
Master Bootstrap Carousel Components for Mobile Web
Bootstrap Carousel Key Components
JavaScript Library
Bootstrap's carousel leverages JavaScript for interactive slideshow functionality. Requires jQuery as a dependency for proper operation.
Mobile Responsive
Built-in classes like hidden-xs allow developers to control component visibility across different screen sizes seamlessly.
CSS Framework
Pre-built markup structure with carousel classes provides consistent styling and behavior across web applications.
This exercise builds on previous Bootstrap exercises (5C-B1). Ensure you have completed the foundational Bootstrap setup before proceeding with carousel implementation.
Setup Verification Steps
Ensures clean workspace and prevents file conflicts
Locates the correct project directory structure
Updates project files to latest exercise state
Establishes proper development environment
Required JavaScript Dependencies
jQuery Library
Links to Google CDN with local fallback. Essential for Bootstrap's JavaScript components to function properly.
Bootstrap JS
Bootstrap's JavaScript file containing carousel functionality. Must be loaded after jQuery dependency is established.
The carousel markup includes indicators, image containers, and navigation controls. Each slide item requires proper class attribution with only the first slide marked as 'active'.
Carousel Slide Structure
While hidden-xs class hides the slideshow visually, images still load on mobile devices. For true performance optimization, consider using CSS background images instead of img tags.
Hidden-xs Implementation
Key Takeaways
