This time I will share jQuery Plugin and tutorial about Minimalist Automatic Gallery Carousel In jQuery, hope it will help you in programming stack.
An ultra-light, fully responsive, full-width, and jQuery based gallery carousel plugin that infinitely loops through a group of images at a given interval.
Just weights in less 1kb and works with 14 lines of JavaScript (jQuery) code.
How to use it:
1. Add images to the carousel slider.
03 |
< img src = "1.jpg" alt = "Alt 1" /> |
04 |
< img src = "2.jpg" alt = "Alt 2" /> |
05 |
< img src = "3.jpg" alt = "Alt 3" /> |
06 |
< img src = "4.jpg" alt = "Alt 4" /> |
07 |
< img src = "5.jpg" alt = "Alt 1" /> |
2. The CSS to make the carousel slider full width.
4 |
transition: all 1 s ease; |
7 |
body .slider .inner img { |
3. Load the necessary jQuery JavaScript library at the end of the HTML document.
1 |
< script src = "/path/to/cdn/jquery.slim.min.js" ></ script > |
4. The JavaScript (jQuery script) to activate the carousel slider.
04 |
const imagesToShow = parseInt($( ".inner *" ).length) |
06 |
if (cont++ <= imagesToShow){ |
07 |
$( ".inner" ).css( "left" ,${left}vw ) |