How we can create a testimonial slider using jQuery and CSS? Solution: Responsive Testimonial Slider With jQuery and CSS, an Automated Slider which slides automatically.
Basically, The slider shows the testimonial or feedback text submitted by your customers or users. You can see on many services providing websites, there is a section which is what our client says about us. In other words, the testimonial is a kind of review. Some of the reviews are featured by the websites that is testimonial.
Today you will learn to create an automated testimonial slider with responsive design. Most websites use testimonials on their home page for better user attraction. When we buy any services or products first we check reviews, that’s why we should use that on our website. If are using any CMS then are so many plugins available to create this feature. But if you have created your websites from scratch & it’s not based on any content management system then this post will helpful for you.
So, Today I am sharing a Responsive Testimonial Slider with jQuery and CSS. This is an automated or autoplay slider for testimonial based on jQuery. I have used a special jquery based library for creating this review slider because of that library made especially for this function. You can show one or multiple testimonials to visitors, just by changing the values.
If you are thinking now how this automatic testimonials slider actually is, then see the video preview given below.
Preview Of Automated Review Slider
See this video preview to getting an idea of how this program looks like.
Now you can see this visually both versions desktop & mobile or small screen versions. If you like this, then get the source code of its.
You May Also Like:
- CSS Input Label Animation
- Custom Google Map Marker
- jQuery Lightweight Accordion
- JavaScript Scroll To Top
Responsive Testimonial Slider With jQuery and CSS Source Code
Before sharing source code, let’s talk about it. As you know I have used a special library for creating this program, which is slick.js (get). Slick JS is developed for making slider or carousel. This library is based on jQuery function, that’s why I am putting this post in JavaScript category because of jQuery also a JavaScript library.
JavaScript or jquery has fewer lines of codes, but they are the main part of this slider. Most of the works is created with CSS, like the layout, UI styling next/previous buttons, etc. I used the font-awesome library to creating the button‘s icon.
There are all the controls in the JS file, I added autoplay: true; you can also disable this by removing or putting false value. After that, you can control how many testimonials want to show on the webpage. For this, there is a command slidesToShow: 2 . After that, there is a command to set how many users review you want to slide on a single slide. That is slidesToScroll: 1 for controlling this. Also, I put a responsive condition.
There are so many things, I can’t explain it in writing. You will understand easily after getting the codes. For creating this program you have to create 3 files. First for HTML, second for CSS, & third for JS. Follow the steps to creating this without any error.
index.html
Create an HTML file named ‘index.html‘ and put these codes given here below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
<!DOCTYPE html> <!--Code By Webdevtrick ( https://webdevtrick.com )--> <html lang="en" > <head> <meta charset="UTF-8"> <title>jQuery Testimonial Slideshow | Webdevtrick.com</title> <link href="https://fonts.googleapis.com/css?family=Lato|Patua+One&display=swap" rel="stylesheet"> <link rel='stylesheet' href='https://netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.min.css'> <link rel="stylesheet" href="style.css"> </head> <body> <div class="container"> <div class="testiSlide"> <div> <figure class="testimonial"> <blockquote>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. <div class="btn"></div> </blockquote> <img src="http://pbs.twimg.com/profile_images/829191018331385858/jxsj-ZmD.jpg" alt="Maksim Goffin" /> <div class="peopl"> <h3>Neil Patel</h3> <p class="indentity">SEO Expert</p> </div> </figure> </div> <div> <figure class="testimonial"> <blockquote>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. <div class="btn"></div> </blockquote> <img src="https://secure.gravatar.com/avatar/24a495e3a7316e619af62445f1a86886?s=96&d=mm&r=g" alt="Maksim Goffin" /> <div class="peopl"> <h3>Shaan</h3> <p class="indentity">Web Developer</p> </div> </figure> </div> <div> <figure class="testimonial"> <blockquote>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. <div class="btn"></div> </blockquote> <img src="https://yt3.ggpht.com/a/AGF-l7_ESQtd3r7nPdFdP_mmyxn65RFy9JlGT0dGyA=s900-mo-c-c0xffffffff-rj-k-no" alt="Maksim Goffin" /> <div class="peopl"> <h3>Brian Dean</h3> <p class="indentity">SEO / Blogger</p> </div> </figure> </div> <div> <figure class="testimonial"> <blockquote>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. <div class="btn"></div> </blockquote> <img src="https://design.sva.edu/wp-content/uploads/2018/08/Sagmeister.jpg" alt="Maksim Goffin" /> <div class="peopl"> <h3>Stefan Sagmeister</h3> <p class="indentity">Graphic Designer</p> </div> </figure> </div> </div> </div> <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js'></script> <script src='http://cdn.jsdelivr.net/jquery.slick/1.6.0/slick.min.js'></script> <script src="function.js"></script> </body> </html> |
style.css
Now create a CSS file named ‘style.css‘ and put these codes.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 |
/* Code By Webdevtrick ( https://webdevtrick.com ) */ html { font-family: 'Lato', sans-serif; font-size: 16px; font-weight: 400; line-height: 1.5; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; background: #fff; color: #333 } body { margin: 0; background: #ff5057; height: 100vh; } h3 { font-family: 'Patua One', cursive; font-weight: 400; font-size: 1.4em; line-height: 1.4em; color: #fff } .container { box-sizing: content-box; max-width: 1000px; margin-left: auto; margin-right: auto; padding-left: 15px; padding-right: 15px; padding-top: 40px; padding-bottom: 40px; } .indentity { margin: 0!important } figure.testimonial { position: relative; float: left; overflow: hidden; margin: 10px 1%; padding: 0 20px; text-align: left; box-shadow: none !important; } figure.testimonial * { -webkit-box-sizing: border-box; box-sizing: border-box; -webkit-transition: all 0.35s cubic-bezier(0.25, 0.5, 0.5, 0.9); transition: all 0.35s cubic-bezier(0.25, 0.5, 0.5, 0.9); } figure.testimonial img { max-width: 100%; vertical-align: middle; height: 90px; width: 90px; border-radius: 50%; margin: 40px 0 0 10px; } figure.testimonial blockquote { background-color: #fff; display: block; font-size: 16px; font-weight: 400; line-height: 1.5em; margin: 0; padding: 25px 50px 30px; position: relative; } figure.testimonial blockquote:before, figure.testimonial blockquote:after { content: "\201C"; position: absolute; color: #ff5057; font-size: 50px; font-style: normal; } figure.testimonial blockquote:before { top: 25px; left: 20px; } figure.testimonial blockquote:after { content: "\201D"; right: 20px; bottom: 0; } figure.testimonial .btn { top: 100%; width: 0; height: 0; border-left: 0 solid transparent; border-right: 25px solid transparent; border-top: 25px solid #fff; margin: 0; position: absolute; } figure.testimonial .peopl { position: absolute; bottom: 45px; padding: 0 10px 0 120px; margin: 0; color: #ffffff; -webkit-transform: translateY(50%); transform: translateY(50%); } figure.testimonial .peopl h3 { opacity: 0.9; margin: 0; } .slick-slider { position: relative; display: block; box-sizing: border-box; user-select: none; -webkit-touch-callout: none; -khtml-user-select: none; -ms-touch-action: pan-y; touch-action: pan-y; -webkit-tap-highlight-color: transparent; } .slick-list { position: relative; display: block; overflow: hidden; margin: 0; padding: 0; } .slick-list:focus { outline: none; } .slick-list.dragging { cursor: pointer; cursor: hand; } .slick-slider .slick-track, .slick-slider .slick-list { transform: translate3d(0, 0, 0); } .slick-track { position: relative; top: 0; left: 0; display: block; } .slick-track:before, .slick-track:after { display: table; content: ''; } .slick-track:after { clear: both; } .slick-loading .slick-track { visibility: hidden; } .slick-slide { display: none; float: left; height: 100%; min-height: 1px; } .slick-slide img { display: block; } .slick-slide.slick-loading img { display: none; } .slick-slide.dragging img { pointer-events: none; } .slick-initialized .slick-slide { display: block; } .slick-loading .slick-slide { visibility: hidden; } .slick-vertical .slick-slide { display: block; height: auto; border: 1px solid transparent; } .slick-btn.slick-hidden { display: none; } .slick-prev, .slick-next { font-size: 0; line-height: 0; position: absolute; top: 40%; display: block; width: 20px; height: 20px; padding: 0; transform: translate(0, -50%); cursor: pointer; color: transparent; border: none; outline: none; background: transparent; } .slick-prev:hover, .slick-prev:focus, .slick-next:hover, .slick-next:focus { color: transparent; outline: none; background: transparent; } .slick-prev:hover:before, .slick-prev:focus:before, .slick-next:hover:before, .slick-next:focus:before { opacity: 1; } .slick-prev:before, .slick-next:before { font-family: "FontAwesome"; font-size: 40px; line-height: 1; opacity: .75; color: white; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } .slick-prev { left: -40px; } .slick-prev:before { content: ""; } .slick-next { right: -40px; } .slick-next:before { content: ""; } |
function.js
The final step, Create a JavaScript file named ‘function.js‘ and put the codes.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
/* Code By Webdevtrick ( https://webdevtrick.com ) */ $(document).ready(function () { $('.testiSlide').slick({ slidesToShow: 2, slidesToScroll: 1, autoplay: true, autoplaySpeed: 1500, responsive: [{ breakpoint: 850, settings: { slidesToShow: 1, slidesToScroll: 1, infinite: true, } }] }); }); |
That’s It. You have successfully created a Responsive Testimonial Slider With jQuery and CSS, An Automated Slider or Carousel. If you have any doubt or question comment down below.
Thanks For Visiting, Keep Visiting.
What if content in any of the boxes is more then the other box. The height will change automatically. How to fix that?
Secondly can you make a PHP submit form. It will send all the details of a user on email?
Good Design Bro
fake fake fake
where is js and cs files