可能重複:
Jquery if conditions false then prevent default不執行的href jQuery的
我有這樣的代碼,它的運行良好,但我希望它是動態的。
$(".nav a").click(function() {
var getid = $(this).attr('id');
$("#background-wrapper").fadeOut("slow");
$("#page_box").fadeOut("slow");
$("header").fadeOut("slow");
$("footer").fadeOut("slow", function() {
window.location = getid+".php";
});
});
我想在使用href引導它之前先執行淡出。
我想這是第一個
$(".nav a").click(function() {
var getid = $(this).attr('id');
$("#background-wrapper").fadeOut("slow");
$("#page_box").fadeOut("slow");
$("header").fadeOut("slow");
$("footer").fadeOut("slow");
});
再經過
.nav a = href = "link"
謝謝!這個人正在和我一起工作。我剛剛刪除了.php結尾,因爲我希望它也有一個外部網址。再次感謝:) – EatCodePlaySleep
偉大的東西!不要忘記接受你的答案! –