【发布时间】:2011-02-13 13:48:16
【问题描述】:
$(document).ready(function() {
//Default Action
$(".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 rel attribute value to identify the active tab + content
$(activeTab).fadeIn("slow"); //Fade in the active content
return false;
});
});
在除 IE 之外的所有应用程序中都可以使用?
【问题讨论】:
-
而不是 return false 你应该使用 preventDefault()
-
嗯。我不希望任何涉及 alpha 混合的东西在 IE 中正常工作,但也许这只是因为它过去对 PNG 的支持有多糟糕......
标签: jquery internet-explorer jquery-animate fadein