Draggable Image Slider
A responsive and touch-friendly image slider that allows users to drag and swipe through images.
Responsive Design
Yes
Dark Mode Support
No
lines
123
Browser Compatibility
Chrome · Firefox · Safari · Edge
Live Preview
Interact with the component without leaving the page.
HTML
10
lines
CSS
39
lines
JavaScript
74
lines
<div class="slider-container">
<div class="slider">
<div class="slide"><img src="https://images.unsplash.com/photo-1682687220247-9f786e34d472?w=600&h=400&fit=crop" alt="Image 1"></div>
<div class="slide"><img src="https://images.unsplash.com/photo-1682685797828-d3b2561de24d?w=600&h=400&fit=crop" alt="Image 2"></div>
<div class="slide"><img src="https://images.unsplash.com/photo-1682687220067-d4914da93544?w=600&h=400&fit=crop" alt="Image 3"></div>
<div class="slide"><img src="https://images.unsplash.com/photo-1682686581220-689c34afb6b3?w=600&h=400&fit=crop" alt="Image 4"></div>
</div>
<button class="prev-btn"><</button>
<button class="next-btn">></button>
</div>
Browser Compatibility
Chrome
≥ 61
Firefox
≥ 60
Safari
≥ 10.1
Edge
≥ 16