【发布时间】:2011-02-12 22:15:03
【问题描述】:
我有一个 JQuery/CSS 选项卡控件,它目前处理 4 个选项卡,包含网格视图。 当您点击选项卡时,我希望加载 gridview。这减少了页面的加载时间,因为某些 gridview 的存储过程需要一些时间。 网格视图需要加载一次,不必每次打开特定选项卡时都更新。
JQuery:
$(document).ready(function()
{
//When page loads...
$(".tab_content").hide(); //Hide all content
$("ul.tabs li:first").addClass("active").show(); //Activate first tab
$(".tab_content:first").show(); //Show first tab content
//On Click Event
$("ul.tabs li").click(function()
{
$("ul.tabs li").removeClass("active"); //Remove any "active" class
$(this).addClass("active"); //Add "active" class to selected tab
$(".tab_content").hide(); //Hide all tab content
var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
$(activeTab).fadeIn(); //Fade in the active ID content
return false;
});
});
现在我刚开始使用 JQuery,所以我真的不知道如何处理这个...... 有什么想法吗?
【问题讨论】:
标签: c# asp.net jquery gridview tabcontrol