另外,更改選項卡內容類的CSS ...
.tab_content {
display:block;
visibility:hidden;
}
...並添加以下添加的行(下// HACK !!! ...)到你的JScript js文件..
$(document).ready(function() {
// When user clicks on tab, this code will be executed
$("#tabs li").click(function() {
// First remove class "active" from currently active tab
$("#tabs li").removeClass('active');
//HACK!!! As the tabs_content HAS to initially be set to display:block in order for the flot graphs to be plotted correctly,
// we need to manually change the visibility attribute for the tabs_content each time another tab is selected as active.
//This assigns a variable to the tab_content of the currently active tab and changes the css visibility attribute to hidden.
var old_tab = $("#tabs li").find("a").attr("href");
$(old_tab).css('visibility', 'hidden');
// Now add class "active" to the selected/clicked tab
$(this).addClass("active");
// Hide all tab content
$(".tab_content").hide();
// Here we get the href value of the selected tab
var selected_tab = $(this).find("a").attr("href");
//HACK!!! Change the css visibility attribute of the newly selected tab to visible
$(selected_tab).css('visibility', 'visible');
$(selected_tab).fadeIn();
return false;
});
});
...並提供您的aspx看起來像......
<div id="tabs" >
<ul id="Ul1" >
<li class="active"><a href="#tab1">Main</a></li>
<li><a href="#tab2">tab2</a></li>
<li><a href="#tab3">tab3</a></li>
<li><a href="#tab4">tab4</a></li>
<li><a href="#tab5">tab5</a></li>
</ul>
</div>
<div style="width:100%;float:left;">
<div id="tabs_content_container">
<div id="tab1" class="tab_content" style="visibility:visible">
content for tab 1
</div>
<div id="tab2" class="tab_content" >
</div>
</div>
</div>
...您的海軍報圖將顯示CORRE並且當相關標籤被選中時!
另外,它似乎如果你不使用歷史插件(我真的不在乎),你沒有這個問題。 – leora 2010-01-04 06:58:25