Download
User Rating: 5/5 ( 1 votes)
BeefUp is a lightweight, responsive jQuery accordion plugin which allows you to toggle the visibility of Html elements.
Features:
-
Multiple accordions on one page.
-
Toggle Html elements via JS or CSS.
-
Multi-level accordions with nested Html elements.
-
Fade or slide animations.
-
Callback support.
Source: github.com
1. INCLUDE JS FILES
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="jquery.beefup.min.js"></script>
2. HTML
<article class="beefup">
<h2 class="beefup-head">Headline</h2>
<div class="beefup-body">My fancy collapsible content.</div>
</article>
3. JAVASCRIPT
$(function() {
$('.beefup').beefup();
});
4. OPTIONS
trigger : '.beefup-head', // String: Name of the trigger element
content : '.beefup-body', // String: Name of the collapsible content
openClass : 'open', // String: Name of the class which shows if a accordion is triggered or not
animation : 'slide', // String: Set animation type, "slide" or "fade"
openSpeed : 200, // Integer: Set the speed of the open animation
closeSpeed : 200, // Integer: Set the speed of the close animation
scroll : false, // Boolean: Scroll to accordion
scrollSpeed : 400, // Integer: Set the speed of the scroll feature
scrollOffset : 0, // Integer: Additional offset to accordion position
openSingle : false, // Boolean: Open just one accordion at once
selfClose : false, // Boolean: Close on click outside
hash : true, // Boolean: Open accordion with id on hash change
onInit : function(){}, // Callback: Fires after the accordions initially setup
onOpen : function(){}, // Callback: Fires after accordion opens content
onClose : function(){} // Callback: Fires after accordion close content
5. ADVANCED
-
Open accordion
var $beefup = $('.beefup').beefup():
$beefup.open($('#beefupID'));
-
Close accordion
$beefup.close($('#beefupID'));
-
Scroll to accordion
$beefup.scroll($('#beefupID'));
-
Callback method
$('.beefup').beefup({
onInit: function ($this) {
// Do something after initially setup
},
onOpen: function ($this) {
// Do something after accordion open the content
},
onClose: function ($this) {
// Do something after accordion close the content
}
});