赞
踩
仅作为学习笔记,供大家参考
总结的不错的话,记得点赞收藏关注哦!
使用原始的面板通过load方法进行渲染,发现load不会加载js,只会加载html,并且地址也会发生改变,故用iframe标签的方法进行平替
<ul id="myTab" class="nav nav-tabs">
<li class="active"><a id="l_repeatTest" href="#repeatTest" data-toggle="tab" >未回复</a></li>
<li><a id="l_syncConfig" href="#syncConfig" data-toggle="tab">申请延期</a></li>
<li><a id="l_channelConfig" href="#syncChannelConfig" data-toggle="tab">已回复</a></li>
<li><a id="l_returned" href="#returned" data-toggle="tab">已退回</a></li>
<li><a id="l_audited" href="#audited" data-toggle="tab">已审核</a></li>
</ul>
<div id="myTabContent" class="tab-content wrapper wrapper-content animated fadeInRight ibox-content">
<div class="tab-pane fade in active" id="repeatTest">
<div class="panel-body">
<iframe class="frame" src="/business/task/task">
</iframe>
</div>
</div>
<div class="tab-pane fade" id="syncConfig">
<div class="panel-body">
<iframe class="frame" src="/business/task/extension">
</iframe>
</div>
</div>
<div class="tab-pane fade" id="syncChannelConfig">
<div class="panel-body">
<iframe class="frame" src="/business/task/replied">
</iframe>
</div>
</div>
<div class="tab-pane fade" id="returned">
<div class="panel-body">
<iframe class="frame" src="/business/task/restart">
</iframe>
</div>
</div>
<div class="tab-pane fade" id="audited">
<div class="panel-body">
<iframe class="frame" src="/business/task/audited">
</iframe>
</div>
</div>
</div>
//刷新后,选中当前的tab
$(document).ready(function () {
$('.nav-tabs a').click(function (e) {
e.preventDefault()
$(this).tab('show')
})
$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
sessionStorage.selectTab = $(e.target).attr('href');
});
var selectedTab = sessionStorage.selectTab;
if (selectedTab) {
$('.nav-tabs a[href="' + selectedTab + '"]').tab('show')
}
})
<style>
.frame {
border: medium none;
width: 100%;
height: 100%;
}
.panel-body {
height: 590px;
}
</style>
创作不易,点个赞就是对我最大的支持~
wxgzh:程序员温眉
CSDN:程序员温眉
每天进步一点点的程序员
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。