在我的页面中,我有一些选项卡...但是根据要求,这些选项卡显示在靠近中间的某个位置...因此,选项卡上方的部分加载速度很快,加载该部分需要一些时间其中包含选项卡...
加载主页时,选项卡内的所有页面也都加载了...所以需要一些时间...我该如何避免这种情况?...
我的代码:
<div class="ui-tabs" id="tabs" style="width: 97%;display:none;">
<ul class="ui-tabs-nav">
<li id="planDetails-tab"><a id="hrefPlanDetailsid" accesskey="p" href="#divPlanDetailsTab" class="planTabHeader"> Plan Details</a></li>
<li id="testPlan-tab"><a id="hrefTestPlanid" accesskey="t" href="#divTestPlanTab" class="planTabHeader"> Test Plan </a></li>
<li id="serviceArea-tab"><a href="#divServiceAreaTab" accesskey="s" class="planTabHeader">Service Area</a></li>
<li id="rates-tab"><a href="#divRatesTab" accesskey="r" class="planTabHeader"> Rates </a></li>
<li id="benefits-tab"><a href="#divBenefitsTab" accesskey="b" class="planTabHeader"> Benefits </a></li>
<li id="network-tab"><a href="#divNetworkEcpTab" accesskey="n" class="planTabHeader">Network ECP</a></li>
<li id="historical-tab"><a href="#divHistoricalTab" accesskey="h" class="planTabHeader"> Historical </a></li>
<li id="directory-tab"><a href="#divDirectoryTab" accesskey="d" class="planTabHeader"> Directory </a></li>
</ul>
<div id="divPlanDetailsTab" style="width: 100%;">
<fieldset>
<s:include value="PlanDetail.jsp" />
</fieldset>
</div>
<div id="divTestPlanTab" style="width: 100%;">
<fieldset>
<s:include value="TestPlan.jsp" />
</fieldset>
</div>
<div id="divServiceAreaTab"
class="ui-state-default ui-corner-top ui-tabs-selected ui-state-active" style="width: 100%;">
<fieldset>
<s:include value="PlanServiceArea.jsp" />
</fieldset>
</div>
<div id="divRatesTab"
class="ui-state-default ui-corner-top ui-tabs-selected ui-state-active" style="width: 100%;">
<fieldset>
<s:include value="Rates.jsp" />
</fieldset>
</div>
<div id="divBenefitsTab" class="ui-state-default ui-corner-top ui-tabs-selected ui-state-active" style="width: 100%;">
<fieldset>
<s:include value="PlanBenefits.jsp" />
</fieldset>
</div>
<div id="divNetworkEcpTab"
class="ui-state-default ui-corner-top ui-tabs-selected ui-state-active" style="width: 100%;">
<fieldset>
<s:include value="NetworkECP.jsp" />
</fieldset>
</div>
<div id="divHistoricalTab" class="ui-state-default ui-corner-top ui-tabs-selected ui-state-active" style="width: 100%;">
<fieldset>
<s:include value="PlanHistorical.jsp" />
</fieldset>
</div>
<div id="divDirectoryTab"
class="ui-state-default ui-corner-top ui-tabs-selected ui-state-active" style="width: 100%;">
<fieldset>
<s:include value="ProviderDirectory.jsp" />
</fieldset>
</div>
</div>
.js 文件:
$(function() {
$tabs = $("#tabs").tabs();
$tabs.css('display','block');
//Initially hide Test Plan tab
$('ul li#testPlan-tab').hide();
$('#hrefTestPlanid').hide();
$tabs.tabs({
active : function(event, ui) {
}
});
});