This post was most recently updated on August 5th, 2024
The slider can use with different templates as a custom slider. As its developed using a simple query, CSS3, HTML5 as well as its support responsiveness up to 320px. Its tested on different and support almost all browsers, mainly Chrome, Mozilafox, Safari, IE, Edge & Opera.
Here is the sample screenshot of the template.
JQuery used for this is given 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 |
$(document).ready(function(){ /* Slider Script Start */ $(".ms-slider-wrapper .slider-nav .items:nth-child(1)").addClass("active"); $(".ms-slider-wrapper .slider-for .items:nth-child(1)").addClass("active"); // Manual Slider JS Start }); function desktopPreviousSlider () { // if ($(window).width() < 769) { var $current_element = Number($(".ms-slider-wrapper .slider-nav .items.active")[0].attributes.count.value); if ($current_element == 1 ) { $current_element = 4; } else { $current_element = $current_element - 1; } sliderDesktopChange($current_element); // } } function desktopNextSlider () { // if ($(window).width() < 769) { var $current_element = Number($(".ms-slider-wrapper .slider-nav .items.active")[0].attributes.count.value); if ($current_element == $(".ms-slider-wrapper .slider-nav .items").length) { $current_element = 1; } else { $current_element = $current_element + 1; } sliderDesktopChange($current_element); // } } // Manual Slider JS End // Sub Page Slider For Desktop Start $(".ms-slider-wrapper .ms-slider .slider-for .items").hide(); $(".ms-slider-wrapper .ms-slider .slider-for .items.active").show(); function sliderDesktopChange(id) { $(".ms-slider-wrapper .slider-nav .items").removeClass("active"); $(".ms-slider-wrapper .slider-nav .items:nth-child(" + id + ")").addClass("active"); $(".ms-slider-wrapper .slider-for .items").removeClass("active"); setTimeout(function() { $(".ms-slider-wrapper .slider-for .items").hide(); $(".ms-slider-wrapper .slider-for .items:nth-child(" + id + ")").show(); }, 500); setTimeout(function() { $(".ms-slider-wrapper .slider-for .items:nth-child(" + id + ")").addClass("active"); }, 600); } // Sub Page Slider For Desktop End /* Slider Script End */ |
HTML is given below:
<html>
<head>
<link rel=”stylesheet” type=”text/css” href=”style.css” />
<script src=”https://code.jquery.com/jquery-3.3.1.min.js” integrity=”sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=” crossorigin=”anonymous”></script>
</head>
<body class=”ms-body”>
<div class=”ms-container”>
<section class=”ms-slider-wrapper ms-section”>
<h3 class=”ms-slider-title”>Mundrisoft Slider Template</h3> <!– Heading Of slider –>
<div class=”slider-nav”> <!– Nav element of slider clickable component –>
<div class=”items” count=”1″ onClick=”sliderDesktopChange(1)”> <!– data count should be for for both slider-nav and slider-for items –>
<!– Item that has to be duplicated with resect to Slider For Items –>
<div class=”items-img”>
<img class=”hovered” src=”./image/hovered/book9.png” alt=”image” draggable=”false”/>
<img class=”non-hovered” src=”./image/hovered/book8.png” alt=”image” draggable=”false”/>
</div>
<h4 class=””>1 Lorem Ipsum</h4>
<hr class=””>
<p class=””>”Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit…”</p>
<span class=”slider-nav-down-arrow”></span>
</div>
<div class=”items” count=”2″ onClick=”sliderDesktopChange(2)”> <!– data count should be for for both slider-nav and slider-for items –>
<!– Item that has to be duplicated with resect to Slider For Items –>
<div class=”items-img”>
<img class=”hovered” src=”./image/hovered/info-box23.png” alt=”image” draggable=”false”/>
<img class=”non-hovered” src=”./image/hovered/info-box7.png” alt=”image” draggable=”false”/>
</div>
<h4 class=””>2 Lorem Ipsum</h4>
<hr class=””>
<p class=””>”Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit…”</p>
<span class=”slider-nav-down-arrow”></span>
</div>
<div class=”items” count=”3″ onClick=”sliderDesktopChange(3)”> <!– data count should be for for both slider-nav and slider-for items –>
<!– Item that has to be duplicated with resect to Slider For Items –>
<div class=”items-img”>
<img class=”hovered” src=”./image/hovered/pricing2.png” alt=”image” draggable=”false”/>
<img class=”non-hovered” src=”./image/hovered/pricing3.png” alt=”image” draggable=”false”/>
</div>
<h4 class=””>3 Lorem Ipsum</h4>
<hr class=””>
<p class=””>”Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit…”</p>
<span class=”slider-nav-down-arrow”></span>
</div>
<div class=”items” count=”4″ onClick=”sliderDesktopChange(4)”> <!– data count should be for for both slider-nav and slider-for items –>
<!– Item that has to be duplicated with resect to Slider For Items –>
<div class=”items-img”>
<img class=”hovered” src=”./image/hovered/teammember1.png” alt=”image” draggable=”false”/>
<img class=”non-hovered” src=”./image/hovered/teammember2.png” alt=”image” draggable=”false”/>
</div>
<h4 class=””>4 Lorem Ipsum</h4>
<hr class=””>
<p class=””>”Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit…”</p>
<span class=”slider-nav-down-arrow”></span>
</div>
<span class=”desktop-previous” onClick=”desktopPreviousSlider()”></span>
<span class=”desktop-next” onClick=”desktopNextSlider()”></span>
</div>
<div class=”slider-for”> <!– Slider For component to be slide onclick of Slider Nav Item –>
<div class=”items” count=”1″> <!– Item that has to be duplicated with resect to Slider Nav Items –>
<div class=”slider-for-left” count=”1″> <!– Slider left component –>
<div>
<h4>1 Lorem ipsum dolor sit amet</h4>
<p>Aliquam ac augue consectetur, faucibus ex eget, accumsan eros. Aliquam aliquam accumsan nibh, et pretium urna pretium ut.
Ut pharetra mauris non sapien porta accumsan.
Aenean nec diam non nulla vehicula vehicula facilisis venenatis ipsum. Morbi vel urna metus.</p>
</div>
</div>
<div class=”slider-for-right” count=”1″> <!– Slider Right Component –>
<div class=”ms-frame” sliderNo=”1″> <!– Heres come the slider Number; inccremented value –>
<!– <a href=”” target=”_blank”> –>
<img class=”ms-frame-img” src=”./image/membership-benefits.png” alt=””>
<!– </a> –>
</div>
</div>
</div>
<div class=”items” count=”2″> <!– Item that has to be duplicated with resect to Slider Nav Items –>
<div class=”slider-for-left” count=”2″> <!– Slider left component –>
<div>
<h4>2 Lorem ipsum dolor sit amet</h4>
<p>Vivamus tempus dolor felis. Duis scelerisque lobortis sapien, gravida pulvinar neque.
Ut elementum pellentesque libero in pretium.
Fusce maximus nunc eget massa tristique vestibulum. Donec quis malesuada purus.</p>
</div>
</div>
<div class=”slider-for-right” count=”2″> <!– Slider Right Component –>
<div class=”ms-frame” sliderNo=”2″> <!– Heres come the slider Number; inccremented value –>
<!– <a href=”” target=”_blank”> –>
<img class=”ms-frame-img” src=”./image/online.jpg” alt=””>
<!– </a> –>
</div>
</div>
</div>
<div class=”items” count=”3″> <!– Item that has to be duplicated with resect to Slider Nav Items –>
<div class=”slider-for-left” count=”3″> <!– Slider left component –>
<div>
<h4>3 Lorem ipsum dolor sit amet</h4>
<p>Aenean vitae velit a tortor vestibulum blandit et non dui. Nam id elit ac purus finibus porta vel sed turpis.
Etiam scelerisque, ligula vitae finibus sodales,
neque justo ullamcorper est, vel mattis mi nisi id velit.</p>
</div>
</div>
<div class=”slider-for-right” count=”3″> <!– Slider Right Component –>
<div class=”ms-frame” sliderNo=”3″> <!– Heres come the slider Number; inccremented value –>
<!– <a href=”” target=”_blank”> –>
<img class=”ms-frame-img” src=”./image/reputation.jpg” alt=””>
<!– </a> –>
</div>
</div>
</div>
<div class=”items” count=”4″> <!– Item that has to be duplicated with resect to Slider Nav Items –>
<div class=”slider-for-left” count=”4″> <!– Slider left component –>
<div>
<h4>4 Lorem ipsum dolor sit amet</h4>
<p>In ac mollis nisi. Praesent porta pulvinar nunc, nec fringilla sem maximus at.
Nunc suscipit felis at malesuada pellentesque.
Nunc dapibus justo fringilla metus hendrerit, vel finibus ipsum mattis.</p>
</div>
</div>
<div class=”slider-for-right” count=”4″> <!– Slider Right Component –>
<div class=”ms-frame” sliderNo=”4″> <!– Heres come the slider Number; inccremented value –>
<!– <a href=”” target=”_blank”> –>
<img class=”ms-frame-img” src=”./image/website.jpg” alt=””>
<!– </a> –>
</div>
</div>
</div>
<span class=”desktop-previous” onClick=”desktopPreviousSlider()”></span>
<span class=”desktop-next” onClick=”desktopNextSlider()”></span>
</div>
</section>
</div>
</body>
</html>
Supporting CSS is given 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 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 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 |
/* Slider CSS Start */ .ms-body { width: 100%; height: auto; margin: 0; background-color: #f3f3f3; display: inline-block; } .ms-body .ms-container { max-width: 1200px; margin: 100px auto; display: block; } .ms-slider-wrapper { } .ms-slider-wrapper-title { font-size: 24px; font-weight: 400; font-family: sans-serif; text-align: center; text-decoration: underline; margin: 10px 0 30px; } .ms-slider-wrapper .slider-for .items.active img { width: 100%; /* height: auto; */ min-width: 100%; max-height: 600px; } .ms-slider-wrapper { display: block; } .ms-slider-wrapper { background-color: #fff; display: inline-block; } .ms-slider-wrapper h3 { color: #002d56; margin-bottom: 40px; font-size: 28px; font-weight: 700; text-align: center; } .ms-slider-wrapper .slider-nav { height: auto; position: relative; width: 90%; margin: 0 auto; } .ms-slider-wrapper .slider-nav .items { text-align: center; cursor: pointer; padding: 12px; border: 2px solid #fff; position: relative; width: 22%; display: inline-block; } .ms-slider-wrapper .slider-nav .items .slider-nav-down-arrow { border-style: solid; border-width: 15px 15px 0 15px; border-color: #fff transparent transparent transparent; position: absolute; bottom: 0px; left: 45%; } .ms-slider-wrapper .slider-nav .items.active .slider-nav-down-arrow { border-color: #99cb2d transparent transparent transparent; } .ms-slider-wrapper .slider-nav .items-img { width: 130px; height: 130px; text-align: center; border-radius: 150px; display: inline-block; background-color: #fff; } .ms-slider-wrapper .slider-nav .items.active .items-img, .ms-slider-wrapper .slider-nav .items:hover .items-img { background-color: #99cb2d; } .ms-slider-wrapper .slider-nav .items.active .items-img { background-color: #99cb2d; } .ms-slider-wrapper .slider-nav .items .items-img .hovered { display: none; } .ms-slider-wrapper .slider-nav .items:hover .items-img .hovered, .ms-slider-wrapper .slider-nav .items.active .items-img .hovered { display: inline-block; } .ms-slider-wrapper .slider-nav .items .items-img .non-hovered { display: inline-block; } .ms-slider-wrapper .slider-nav .items:hover .items-img .non-hovered, .ms-slider-wrapper .slider-nav .items.active .items-img .non-hovered { display: none; } .ms-slider-wrapper .slider-nav .items .items-img img { width: 60%; height: 60%; margin-top: 28px; } .ms-slider-wrapper .slider-nav .items h4 { margin: 10px auto 5px; color: #002d56; font-weight: 700; font-size: 22px; line-height: 1; width: 85%; } .ms-slider-wrapper .slider-nav .items hr { margin: 0 auto 5px auto; width: 40px; display: inline-block; border: 1px solid #99cb2d; } .ms-slider-wrapper .slider-nav .items p { color: #002d56; line-height: 1.2; font-size: 15px; } .ms-slider-wrapper .slider-for { width: 90%; height: auto; position: relative; margin: 60px auto; min-height: 360px; } .ms-slider-wrapper .slider-nav .desktop-previous, .ms-slider-wrapper .slider-for .desktop-previous { border-style: solid; border-width: 40px 40px 40px 0; border-color: transparent #99cb2d transparent transparent; position: absolute; left: -5%; top: 35%; cursor: pointer; } .ms-slider-wrapper .slider-nav .desktop-previous, .ms-slider-wrapper .slider-nav .desktop-next { /* display: none; */ } .ms-slider-wrapper .slider-nav .desktop-next, .ms-slider-wrapper .slider-for .desktop-next { border-style: solid; border-width: 40px 0 40px 40px; border-color: transparent transparent transparent #99cb2d; position: absolute; right: -5%; top: 35%; cursor: pointer; } .ms-slider-wrapper .slider-for .items { overflow: hidden; display: none; } .ms-slider-wrapper .slider-for .items.active { overflow: hidden; display: block; } .ms-slider-wrapper .slider-for .items .slider-for-left { width: 48%; margin-right: 2%; display: inline-block; vertical-align: top; } .ms-slider-wrapper .slider-for .items .slider-for-right { width: 48%; margin-right: 0%; display: inline-block; } .ms-slider-wrapper .slider-for .items .slider-for-left > div { transition: 0.6s ease-in-out; right: 0%; opacity: 1; } .ms-slider-wrapper .slider-for .items h4 { font-size: 28px; color: #99cb2d; font-weight: 600; margin-bottom: 20px; display: block; } .ms-slider-wrapper .slider-for .items p { line-height: 1.5; color: #002d56; font-size: 20px; display: block; } .ms-slider-wrapper .slider-for .items .ms-btn { border-radius: 50px; background-color: #99cb2d; color: #fff; border: 1px solid #99cb2d; padding: 10px 80px; font-weight: 700; display: inline-block; cursor: pointer; } .ms-slider-wrapper .slider-for .items .ms-btn:hover { color: #99cb2d; background-color: transparent; } .ms-slider-wrapper .slider-for .items .slider-for-right > div, .ms-slider-wrapper .slider-for .items video, .ms-slider-wrapper .slider-for .items img { transition: 0.6s ease-in-out; left: 0%; opacity: 1; width: 100%; height: auto; } .ms-slider-wrapper .slider-for .items video .ms-slider-wrapper .slider-for .items img { width: 100%; height: auto; position: relative; min-width: 100%; } .ms-slider-wrapper .slider-for .items .slider-for-right > div, .ms-slider-wrapper .slider-for .items .slider-for-right video, .ms-slider-wrapper .slider-for .items .slider-for-right img { left: 110%; opacity: 0.4; transition: 0.6s ease-in-out; position: relative; } .ms-slider-wrapper .slider-for .items.active .slider-for-right > div, .ms-slider-wrapper .slider-for .items.active .slider-for-right video, .ms-slider-wrapper .slider-for .items.active .slider-for-right img { transition: 0.6s ease-in-out; left: 0%; opacity: 1; position: relative; } .ms-slider-wrapper .slider-for .items .slider-for-left > div { position: relative; right: 110%; opacity: 0.4; transition: 0.6s ease-in-out; } .ms-slider-wrapper .slider-for .items.active .slider-for-left > div { transition: 0.6s ease-in-out; right: 0%; opacity: 1; } /* Slider CSS End */ /* Responsiveness Start */ @media (max-width: 1200px) { .ms-slider-wrapper .slider-nav .items { width: 21%; } } @media (max-width: 1000px) { .ms-slider-wrapper .slider-nav .items:nth-child(3) { clear: none; } .ms-slider-wrapper .slider-for .items .slider-for-left, .ms-slider-wrapper .slider-for .items .slider-for-right { width: 48%; margin-right: 1%; } .ms-slider-wrapper .slider-nav .desktop-previous, .ms-slider-wrapper .slider-for .desktop-previous { border-width: 30px 25px 30px 0; } .ms-slider-wrapper .slider-nav .desktop-next, .ms-slider-wrapper .slider-for .desktop-next { border-width: 30px 0 30px 25px; } .ms-slider-wrapper .slider-nav .items { width: 20%; } } @media (max-width: 767px) { .ms-slider-wrapper h3, .ms-slider-wrapper .slider-nav .items h4, .ms-slider-wrapper .slider-for .items h4 { font-size: 20px; line-height: 1; } .ms-slider-wrapper .slider-for .items .ms-btn { padding: 5px 60px; } .ms-slider-wrapper .slider-nav .items p, .ms-slider-wrapper .slider-for .items p { text-align: left; font-size: 16px; line-height: 1; } .ms-slider-wrapper .slider-nav .desktop-previous, .ms-slider-wrapper .slider-nav .desktop-next { display: inline-block; } .ms-slider-wrapper .slider-nav .items { width: 80%; margin: 10px 10%; display: none; } .ms-slider-wrapper .slider-nav .items.active { display: inline-block; } .ms-slider-wrapper .slider-for .items .slider-for-left, .ms-slider-wrapper .slider-for .items .slider-for-right { width: 80%; margin: 10px 10%; text-align: center; } .ms-slider-wrapper .slider-for .items.active img { min-height: auto; } .ms-slider-wrapper .slider-nav .items { display: none; } .ms-slider-wrapper .slider-nav .items.active { display: inline-block; } .ms-slider-wrapper .slider-nav .items .slider-nav-down-arrow { left: 47%; } .ms-slider-wrapper .slider-for { margin-top: 10px; } .ms-slider-wrapper .slider-for .items.active img { max-width: 60% !important; margin: 0 auto; min-width: 50%; } } /* Responsiveness End */ |