1
我有一个页面上有一些标签,并在点击某些标签时,其他页面会动态加载。唯一的问题是这些页面每次点击标签时都会加载。如何在第一次点击时只加载一次?jQuery加载页面只有一次选项卡点击
,我使用的代码是这样的:
$(document).ready(function(){
$(".tab-content").hide();
$("#one").show();
$("a.tab-name").click(function(){
$(".tab-name-active").removeClass("tab-name-active");
$(this).addClass("tab-name-active");
$(".tab-content").fadeOut();
var content_show=$(this).attr("title");
if (content_show === 'three') {
$("#"+content_show).load('new-page.php', function() {
$("#sorttable").tablesorter({
headers: {0: {sorter: false}}
});
});
}
else if (content_show === 'four') {
$("#"+content_show).load('new-page-2.php');
}
$("#"+content_show).delay(100).fadeIn('slow');
return false;
});
});
谢谢!
谢谢,男人!你救了我的一天! :) – Alex 2010-08-18 08:16:01