This time I will share jQuery Plugin and tutorial about Infinite Carousel Slider With jQuery And CSS3, hope it will help you in programming stack.
A simple, lightweight image carousel slider built with HTML, CSS/SCSS, CSS3 animations, and a little bit of jQuery.
How to use it:
1. Add images together with the SVG based next/prev arrows to the slider.
01 |
< div class = "slider right" > |
03 |
< div class = "arrow left" > |
05 |
< path d = "M222.979 5.424C219.364 1.807 215.08 0 210.132 0c-4.949 0-9.233 1.807-12.848 5.424L69.378 133.331c-3.615 3.617-5.424 7.898-5.424 12.847s1.809 9.233 5.424 12.847l127.906 127.907c3.614 3.617 7.898 5.428 12.848 5.428 4.948 0 9.232-1.811 12.847-5.428 3.617-3.614 5.427-7.898 5.427-12.847V18.271c-.001-4.949-1.81-9.229-5.427-12.847z" fill = "#FFFFFF" /> |
09 |
< div class = "container-images" > |
10 |
< img class = "active" src = "1.jpg" > |
18 |
< div class = "arrow right" > |
20 |
< path d = "M222.979 5.424C219.364 1.807 215.08 0 210.132 0c-4.949 0-9.233 1.807-12.848 5.424L69.378 133.331c-3.615 3.617-5.424 7.898-5.424 12.847s1.809 9.233 5.424 12.847l127.906 127.907c3.614 3.617 7.898 5.428 12.848 5.428 4.948 0 9.232-1.811 12.847-5.428 3.617-3.614 5.427-7.898 5.427-12.847V18.271c-.001-4.949-1.81-9.229-5.427-12.847z" fill = "#FFFFFF" /> |
2. The required CSS/CSS3 rules for the slider & slider controls.
04 |
justify- content : space-between; |
13 |
.slider .arrow:hover { |
17 |
.slider .arrow. right { |
18 |
transform: rotate( 180 deg); |
21 |
.slider .container-images { |
26 |
-webkit-box-shadow: 10px 10px 61px -10px rgba( 0 , 0 , 0 , 0.75 ); |
27 |
-moz-box-shadow: 10px 10px 61px -10px rgba( 0 , 0 , 0 , 0.75 ); |
28 |
box-shadow: 10px 10px 61px -10px rgba( 0 , 0 , 0 , 0.75 ); |
31 |
.slider .container-images img { |
35 |
transition-duration: . 5 s; |
36 |
transform: translateY( -50% ); |
39 |
.slider. right .container-images img { |
44 |
.slider. right .container-images img.active { |
49 |
.slider. right .container-images img.to_right { |
53 |
.slider. left .container-images img { |
58 |
.slider. left .container-images img.active { |
63 |
.slider. left .container-images img.to_left { |
3. Place the needed jQuery library at the end of the document.
4. The jQuery script to switch between images when the user clicks the next/prev arrows.
01 |
$(window).on( 'load' , function () { |
04 |
$( '.slider .container-images img' ).each( function () { |