jQuery – Collapser plugin
| 42,044 views | 178 Comments
Jquery collapser is a multi purpose collapser plugin made for expanding and collapsing elements. Can create a accordion, list collapser using this plugin
Download v1.0
- Features
- Demo
- Documentation
- Download
Features
- Very light-weight plugin, fast and simple.
- Can collapse any element within an document.
- Can add seperate classes for expanding and collapsing.
- Customized targeting elements.
- Callback functions.
- Predetection of collapsed elements.
- Can create accordion, list collapsers etc by adding a single additional line.
- Cross browser supported.
Donate & Support with Paypal
Documentation
Basic Usage
$('Element selector').collapser({
target: 'next',
targetOnly: null,
effect: 'slide',
changeText: true,
expandHtml: 'Expand',
collapseHtml: 'Collapse',
expandClass: '',
collapseClass:''
}, before_collapse_callback_function , after_collapse_callback_function);
Plugin properties
Jquery collapser consist of 8 properties for customizing the collapser.
- target:
- This property allows to target the collapsing element. Values accepted are:
- next – Collapses the next element.
- prev – Collapses the previous element.
- siblings – Collapses all siblings.
- Any element selector.
- targetOnly:
- This property is effective only when the target is set to
nextandprevelements. Accepted value is any element selector. This collapses next, prev elements only of the specified selector. - effect:
- The effect of collapsing. Values accepted are:
- slide – For sliding effect.
- fade – For fade effect.
- changeText:
- Allows to change the collapsing the text. Values are true (to change text) and false (to not to change the text)
- expandHtml:, collapseHtml:
- Expand and collapse Html for the collapser
- expandClass:, collapseClass:
- Expand and collapse class for the collapser
Callback functions
More features can be added to collapser by using the callback functions. These can be named functions or anonymous functions
- Example – Anonymous functions
-
$('Element selector').collapser({ target: 'next', targetOnly: null, effect: 'slide', changeText: true, expandHtml: 'Expand', collapseHtml: 'Collapse', expandClass: '', collapseClass:'' }, function(){ alert('Before collapse'); } , function(){ alert(''After collapse'); }); - Example – Named functions
-
$('Element selector').collapser({ target: 'next', targetOnly: null, effect: 'slide', changeText: true, expandHtml: 'Expand', collapseHtml: 'Collapse', expandClass: '', collapseClass:'' }, beforeCallback, afterCallback); function beforeCallback(){ alert('Before callback'); } function afterCallback(){ alert('After callback'); }
Comments
Pingback: 14 Outstanding jQuery Plugins & Tutorials « The Creative Project
Pingback: 50 Useful jQuery Plugins to Enhance your Forms - Noupe Design Blog
Pingback: 50 Useful jQuery Plugins to Enhance your Forms | my computer geek
Pingback: 50 Useful jQuery Plugins to Enhance your Forms | excreters.com
Pingback: 50 Useful jQuery Plugins to Enhance your Forms | Neil Kearney Design
Pingback: 50 Useful jQuery Plugins to Enhance your Forms « qeqnes | Designing. jQuery, Ajax, PHP, MySQL and Templates
Pingback: [HTML5] 50个有用的jQuery插件 « Cookfl
Pingback: Content meets Interface « Family Map
Pingback: Coming Together « Family Map
Pingback: 50 Useful jQuery Plugins to Enhance your Forms | Solar Hunter
Pingback: 50 tane kullanışlı jQuery eklentisi | Yaşarcan Kasal
Pingback: 10 jQuery Scripts To Optimize Forms | Devlounge
Pingback: 200 AJAX & JavaScript Techniques
Pingback: 50 Useful jQuery Plugins to Enhance your Forms | Woupe Design Blog
Pingback: 50 Useful jQuery Plugins to Enhance your Forms | Timesneed.com
Pingback: 50 Useful jQuery Plugins to Enhance your Forms | qeqnes | Designing. jQuery, Ajax, PHP, MySQL and Templates
Pingback: 20 jQuery Table Plugins
Pingback: 20 jQuery Table Plugins - Welege
Pingback: 10 jQuery Scripts To Optimize Forms | Add Colours
Pingback: 20个非常有用的jQuery表格插件 | 贝塔熊 | betabears
Pingback: Aakasha web | Farestrans
Pingback: FreeDownloadSecrets.com » Extensive Collection Of Useful jQuery Plugins For Working With Tables
Pingback: 28 Useful jQuery Plugins for Working with Tables | 1step web design: Best for developer and designer