Customizable Content Toggle Plugin For jQuery Elevator - Download Customizable Content Toggle Plugin For jQuery - Elevator

Download Customizable Content Toggle Plugin For jQuery – Elevator

Posted on

This time I will share jQuery Plugin and tutorial about Customizable Content Toggle Plugin For jQuery – Elevator, hope it will help you in programming stack.

Customizable Content Toggle Plugin For jQuery Elevator - Download Customizable Content Toggle Plugin For jQuery - Elevator
File Size: 7.22 KB
Views Total: 1710
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

Elevator is a jQuery content toggle plugin which enables the user to expand, collapse or toggle sections of content just like an accordion interface.

How to use it:

1. To use this plugin, you need to load the jQuery Elevator plugin’s JS and CSS files in the webpage which has jQuery library loaded.

1 <script src="//code.jquery.com/jquery.min.js"></script>
2 <link rel="stylesheet" href="jquery.tcg-elevator.css">
3 <script src="jquery.tcg-elevator.min.js"></script>

2. Create toggleable content and toggle control as follows:

1 <div class="tcg-elevator">
2   <div class="tcg-elevator-toggle">
3     <h3>Click me</h3>
4   </div>
5   <div class="tcg-elevator-content">
6     Main Content Goes Here
7   </div>
8 </div>

3. Call the function on the top container to active the plugin.

1 $('.tcg-elevator').tcgElevator();

4. Change the default animation speeds.

1 $('.tcg-elevator').tcgElevator({
2   speed: 400,
3   openingSpeed: false,
4   closingSpeed: false,
5 });

5. Change the default CSS classes.

1 $('.tcg-elevator').tcgElevator({
2   toggleSelector: '.tcg-elevator-toggle',
3   contentSelector: '.tcg-elevator-content',
4   openClass: 'tcg-elevator-open',
5   openingClass: 'tcg-elevator-opening',
6   closingClass: 'tcg-elevator-closing'
7 });

6. You can also create a button to toggle all the toggleable content:

1 var closed = true;
2 $('.toggle-button').click(function(e){
3   var functionToCall = closed ? 'open' : 'close';
4   closed = !closed;
5   $('.tcg-elevator').tcgElevator(functionToCall);
6 })

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

source : jqueryscript.net