CaiWu/Scripts/Easyui/src/jquery.accordion.js
(开头部分) 10KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
/**
* accordion - jQuery EasyUI
*
* Copyright (c) 2009-2013 www.jeasyui.com. All rights reserved.
*
* Licensed under the GPL or commercial licenses
* To use it on other terms please contact us: info@jeasyui.com
* http://www.gnu.org/licenses/gpl.txt
* http://www.jeasyui.com/license_commercial.php
*
* Dependencies:
* panel
*
*/
(function($){
function setSize(container){
var state = $.data(container, 'accordion');
var opts = state.options;
var panels = state.panels;
var cc = $(container);
opts.fit ? $.extend(opts, cc._fit()) : cc._fit(false);
if (!isNaN(opts.width)){
cc._outerWidth(opts.width);
} else {
cc.css('width', '');
}
var headerHeight = 0;
var bodyHeight = 'auto';
var headers = cc.find('>div.panel>div.accordion-header');
if (headers.length){
headerHeight = $(headers[0]).css('height', '')._outerHeight();
}
if (!isNaN(opts.height)){
cc._outerHeight(opts.height);
bodyHeight = cc.height() - headerHeight*headers.length;
} else {
cc.css('height', '');
}
_resize(true, bodyHeight - _resize(false) + 1);
function _resize(collapsible, height){
var totalHeight = 0;
for(var i=0; i<panels.length; i++){
var p = panels[i];
var h = p.panel('header')._outerHeight(headerHeight);
if (p.panel('options').collapsible == collapsible){
var pheight = isNaN(height) ? undefined : (height+headerHeight*h.length);
p.panel('resize', {
width: cc.width(),
height: (collapsible ? pheight : undefined)
});
totalHeight += p.panel('panel').outerHeight()-headerHeight;
}
}
return totalHeight;
后面还有 350 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
