jQuery fadeIn()在IE中不工作
适用于除IE之外的所有情况?您可以这样做以获得一致的行为:jQuery fadeIn()在IE中不工作,jquery,internet-explorer,jquery-animate,fadein,Jquery,Internet Explorer,Jquery Animate,Fadein,适用于除IE之外的所有情况?您可以这样做以获得一致的行为: $(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 con
$(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不喜欢返回“#id”
,而是认为您需要:”http://site.com/currentPage.html#id“
,这对选择器不起作用:)我从DOM元素中抓取.hash
,只得到他#id
部分
$(this).find(“a”).attr(“href”)
获取目标的href,而不是目标。假设您将DIV的名称放在href中,这可能是正确的(我不知道里面有什么)
尝试
alert($(this).find(“a”).href())
查看您是否获得了正确的元素,或者尝试.show()
看看会发生什么。您应该使用preventDefault()Hmm,而不是返回false。我不希望涉及alpha混合的任何内容在IE中正常工作,但也许这仅仅是因为它在支持PNG方面有多么糟糕。。。
var activeTab = $(this).find("a").get(0).hash;