$(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瀏覽器?jQuery fadeIn()在IE中不工作
而不是返回false你應該使用preventDefault() – Samuel 2010-04-28 22:13:39
嗯。我不希望任何涉及alpha混合的東西在IE中正常工作,但也許這僅僅是因爲它支持PNG的程度有多嚴重...... – SamB 2010-04-28 22:15:15