前端之家收集整理的这篇文章主要介绍了
javascript – 如何扩展jQuery手风琴插件,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
$.extend($.ui.multiAccordion,{
// private helper method that used to show tabs
_showTab: function($this) {
var $span = $this.children('span.ui-icon');
var $div = $this.next();
var options = this.options;
$this.removeClass('ui-state-default ui-corner-all').addClass('ui-state-active ui-corner-top');
$span.removeClass('ui-icon-triangle-1-e').addClass('ui-icon-triangle-1-s');
// MODIIFICATION
bindThis = this;
var ui = {
tab: $this,content: $this.next('div')
}
$div.slideDown('fast',function(){
$div.addClass(options._classes.divActive);
// MODIFICATION
bindThis._trigger('tabShownComplete');
});
this._trigger('tabShown',null,ui);
},// private helper method that used to show tabs
_hideTab: function($this) {
var $span = $this.children('span.ui-icon');
var $div = $this.next();
var options = this.options;
$this.removeClass('ui-state-active ui-corner-top').addClass('ui-state-default ui-corner-all');
$span.removeClass('ui-icon-triangle-1-s').addClass('ui-icon-triangle-1-e');
// MODIIFICATION
bindThis = this;
var ui = {
tab: $this,content: $this.next('div')
}
$div.slideUp('fast',function(){
$div.removeClass(options._classes.divActive);
// MODIFICATION
bindThis._trigger('tabHiddenComplete',ui);
});
this._trigger('tabHidden',ui);
}
});
> https://gist.github.com/4342758
原文链接:https://www.f2er.com/jquery/153607.html