代码拉取完成,页面将自动刷新
同步操作将从 xknaan/Bootstrap_for_DWZ 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
<script type="text/javascript">
function toCollapse(t) {
var $panel = $('#accordion', navTab.getCurrentPanel());
var initAccordion = function() {
var hBox = $panel.data('heightbox'), height = $panel.data('height');
var offsety = $panel.data('offsety') || 0;
var height = height || ($(hBox).height() - (offsety * 1));
var $pheader = $panel.find('.panel-heading');
var h1 = $pheader.outerHeight();
$panel.css('height', height);
height = height - (h1 * $pheader.length) - (5 * ($pheader.length));
$panel.find('.panel-collapse').find('.panel-body').css('height', height);
}
switch (t) {
case 1:
$panel.addClass('panel-condensed');
break;
case 2:
$panel.removeClass('panel-condensed');
break;
case 3:
$panel.css('height', 'auto').removeClass('j-accordion').removeAttr('data-heightbox').removeAttr('data-height').find('.panel-body').css('height', 'auto');
break;
case 4:
$panel.css('height', 'auto').addClass('j-accordion').data('height', '200').find('.panel-body').css('height', 'auto');
initAccordion();
break;
case 5:
$panel.css('height', 'auto').addClass('j-accordion').data('height', '300').find('.panel-body').css('height', 'auto');
initAccordion();
break;
}
}
</script>
<div class="pageContent">
<div class="pageFormContent" layouth="29">
<div style="margin: 0 auto; width: 550px;">
<fieldset>
<legend>紧凑型滑动面板</legend>
<div style="margin: 0 auto; width: 500px; height: 350px;" id="accordion-box">
<div class="panel-group panel-condensed j-accordion" id="accordion" data-heightbox="#accordion-box" data-height="200" data-offsety="0">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" href="#collapseOne">滑动面板 #1</a></h4>
</div>
<div id="collapseOne" class="panel-collapse collapse in">
<div class="panel-body">
<p>我是第一个滑动面板。这里可以放我想放置的内容!</p>
<p>panel-group 面板添加Class [<span class="red">panel-condensed</span>] 即显示为紧凑型,添加Class [<span class="red">j-accordion</span>],同时也添加属性[<span class="red">data-heightbox="#accordion-box"</span> 或 <span class="red">data-height="150"</span>]可以定义滑动面板的高度,超出显示滚动条</p>
<p>* 说明:data-heightbox表示整个滑动面板的高度等于data-heightbox定义的元素高度。<br>
data-height表示整个滑动面板的高度等于data-height定义的高度,data-height优先于data-heightbox</p>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapseTwo">滑动面板 #2</a>
</h4>
</div>
<div id="collapseTwo" class="panel-collapse collapse">
<div class="panel-body">
<p>第二个滑动面板的内容</p>
<p>* 非紧凑型面板则不添加Class [<span class="red">panel-condensed</span>]</p>
<p>* 自动高度的滑动面板不需要添加Class [<span class="red">j-accordion</span>]及属性[<span class="red">data-heightbox="#accordion-box"</span> 或 <span class="red">data-height="150"</span>]</p>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" href="#collapseThree">滑动面板 #3</a></h4>
</div>
<div id="collapseThree" class="panel-collapse collapse">
<div class="panel-body">
这里是第三个滑动面板的内容!!!
<p><span class="red">*</span> 其他参数参见<a href="http://v3.bootcss.com/javascript/#collapse" target="_blank">http://v3.bootcss.com/javascript/#collapse</a></p>
</div>
</div>
</div>
</div>
</div>
<p><span class="red">*</span> 其他参数参见<a href="http://v3.bootcss.com/javascript/#collapse" target="_blank">http://v3.bootcss.com/javascript/#collapse</a></p>
<div class="btn-group">
<button type="button" class="btn btn-default btn-sm" onclick="toCollapse(1);">紧凑型</button>
<button type="button" class="btn btn-default btn-sm" onclick="toCollapse(2);">正常型</button>
<button type="button" class="btn btn-default btn-sm" onclick="toCollapse(3);">自动高度</button>
<button type="button" class="btn btn-default btn-sm" onclick="toCollapse(4);">固定高度:200</button>
<button type="button" class="btn btn-default btn-sm" onclick="toCollapse(5);">固定高度:300</button>
</div>
</fieldset>
</div>
<br>
<p>实例代码:</p>
<pre><div class="panel-group panel-condensed j-accordion" id="accordion" data-heightbox="#accordion-box" data-height="200" data-offsety="0">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" href="#collapseOne">滑动面板 #1</a></h4>
</div>
<div id="collapseOne" class="panel-collapse collapse in">
<div class="panel-body">
<p>我是第一个滑动面板。这里可以放我想放置的内容!</p>
<p>panel-group 面板添加Class [<span class="red">panel-condensed</span>] 即显示为紧凑型,添加Class [<span class="red">j-accordion</span>],同时也添加属性[<span class="red">data-heightbox="#accordion-box"</span> 或 <span class="red">data-height="150"</span>]可以定义滑动面板的高度,超出显示滚动条</p>
<p>* 说明:data-heightbox表示整个滑动面板的高度等于data-heightbox定义的元素高度。<br>
data-height表示整个滑动面板的高度等于data-height定义的高度,data-height优先于data-heightbox</p>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapseTwo">滑动面板 #2</a>
</h4>
</div>
<div id="collapseTwo" class="panel-collapse collapse">
<div class="panel-body">
<p>第二个滑动面板的内容</p>
<p>* 非紧凑型面板则不添加Class [<span class="red">panel-condensed</span>]</p>
<p>* 自动高度的滑动面板不需要添加Class [<span class="red">j-accordion</span>]及属性[<span class="red">data-heightbox="#accordion-box"</span> 或 <span class="red">data-height="150"</span>]</p>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" href="#collapseThree">滑动面板 #3</a></h4>
</div>
<div id="collapseThree" class="panel-collapse collapse">
<div class="panel-body">
这里是第三个滑动面板的内容!!!
<p><span class="red">*</span> 其他参数参见<a href="http://v3.bootcss.com/javascript/#collapse" target="_blank">http://v3.bootcss.com/javascript/#collapse</a></p>
</div>
</div>
</div>
</div></pre>
</div>
<div class="formBar">
<ul>
<li><button type="button" class="btn btn-close btn-sm">关闭</button></li>
</ul>
</div>
</div>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。