Smooth jQuery Based Accordion style Image Slider Accordion js - Download Smooth jQuery Based Accordion-style Image Slider - Accordion.js

Download Smooth jQuery Based Accordion-style Image Slider – Accordion.js

Posted on

This time I will share jQuery Plugin and tutorial about Smooth jQuery Based Accordion-style Image Slider – Accordion.js, hope it will help you in programming stack.

Smooth jQuery Based Accordion style Image Slider Accordion js - Download Smooth jQuery Based Accordion-style Image Slider - Accordion.js
File Size: 6.17 KB
Views Total: 3981
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

A lightweight and CSS-less jQuery plugin used for generating a horizontal accordion-style slider where the image auto expands to the full size and collapses the others on mouse hover.

How to use it:

1. Insert your images as backgrounds to the accordion slider as follows:

1 <div class="my<a href="https://www.jqueryscript.net/slider/">Slider</a>">
2   <ul>
3     <li style="background:url(1.jpg) -25px 0 no-repeat"></li>
4     <li style="background:url(2.jpg) -25px 0 no-repeat"></li>
5     <li style="background:url(3.jpg) -25px 0 no-repeat"></li>
6     <li style="background:url(4.jpg) -25px 0 no-repeat"></li>
7     <li style="background:url(5.jpg) -25px 0 no-repeat"></li>
8   </ul>
9 </div>

2. The basic CSS styles.

01 .mySlider {
02   width: 1000px;
03   height: 398px;
04   overflow: hidden;
05   margin: 0 auto;
06 }
07  
08 .mySlider li {
09   width: 166.6px;
10   height: 398px;
11   float: left;
12   box-shadow: 0 28px 14px rgba(0,0,0,0.25), 0 10px 10px rgba(0,0,0,0.22);
13 }

3. Download the insert the jQuery Accordion.js script into the document.

1 <script src="//code.jquery.com/jquery.min.js"></script>
2 <script src="src/jquery.accordion.js"></script>

4. Call the plugin with options on the top container.

1 $('.mySlider').accordion({
2   currentWidth:'874',
3   otherWidth:'25',
4   itemDefautWidth:'166'
5 })

5. Call the plugin with options on the top container.

1 $('.mySlider').accordion({
2   currentWidth:'874',
3   otherWidth:'25',
4   itemDefautWidth:'166'
5 })

6. Change the default animation speed.

1 $('.mySlider').accordion({
2   currentWidth:'874',
3   otherWidth:'25',
4   itemDefautWidth:'166',
5   speed:500
6 })

This awesome jQuery plugin is developed by Sunnyson303. For more Advanced Usages, please check the demo page or visit the official website.

source : jqueryscript.net