BeefUp是一个轻量级、响应迅速的jQuery手风琴插件,它允许您通过以下功能切换Html元素的可见性:
1.在文档底部包含最新版本的jQuery库和jQuery增强插件。
<script src="/path/to/cdn/jquery.min.js"></script> <script src="jquery.beefup.js"></script>
2.创建一个简单的手风琴,使用简单的Html结构。
<article class="demo"> <h2 class="beefup-head">Accordion Header</h2> <div class="beefup-body"> <p>Accordion Body</p> </div> </article>
3.使用默认选项调用插件。
$('.demo').beefup();
4.根据你的喜好设计手风琴。
.beefup-head { cursor: pointer; position: relative; } .beefup-head:after { border-style: solid; border-width: 12px 12px 0 12px; border-color: #ddd transparent transparent transparent; content: ''; position: absolute; right: 0; height: 0; margin-top: -6px; top: 50%; width: 0; } .open > .beefup-head:after { border-width: 0 12px 12px 12px; border-color: transparent transparent #ddd transparent; }
5.可用选项和默认值。
$('.demo').beefup({ // Boolean: Enable accessibility features like tab control accessibility: true, // String: Name of the trigger element trigger: '.beefup__head', // String: Name of the collapsible content content: '.beefup__body', // String: Name of the class which shows if a accordion is triggered or not openClass: 'is-open', // String: Set animation type to "slide", "fade" or leave empty "" animation: 'slide', // Integer: Set the speed of the open animation openSpeed: 200, // Integer: Set the speed of the close animation closeSpeed: 200, // Boolean: Scroll to accordion scroll: false, // Integer: Set the speed of the scroll feature scrollSpeed: 400, // Integer: Additional offset to accordion position scrollOffset: 0, // Boolean: Open just one accordion at once openSingle: false, // Mixed: Leave one item open, accepts null, integer or string stayOpen: null, // Boolean: Close on click outside selfClose: false, // Boolean: Block close event on click selfBlock: false, // Boolean: Open accordion with id on hash change hash: true, // Mixed: Null or array of objects breakpoints: null });
6.回调函数。
$('.demo').beefup({ onInit: function() {}, onOpen: function() {}, onClose: function() {}, onScroll: function() {} });
v1.4.9 (2022-12-12)
v1.4.8 (2022-10-11)
v1.4.7 (2022-07-11)
v1.4.6 (2022-04-04)
v1.4.5 (2022-02-14)
v1.4.4 (2021-12-02)
第1.4.3节(2021-10-30)
v1.4.2 (2021-09-23)
v1.4.1 (2021-09-03)
第1.4.0节(2021-07-14)
v1.3.1 (2021-06-02)
v1.3.0 (2021-05-31)
v1.2.5 (2021-05-14)
v1.2.4 (2021-04-08)
v1.2.3 (2021-04-07)
第1.2.2节(2021-04-06)
v1.2.1 (2020-10-07)
2019-11-03
v1.2.0版本(2019-10-05)
v1.1.9(2019年9月30日)
v1.1.8 (2019-09-28)
2018-11-12
2018-08-02
2018-02-07
2016-10-02
2016-09-28
2014-09-11
2014-07-18
2014-07-09