有一個的fancybox Ajax調用的jQuery的fancybox關閉錯誤
$.ajax({
type: 'POST',
url: 'sendmesse.php',
data: $("#messform").serialize(),
success: function(data) {
if(data == "true") {
$("#messform").fadeOut("fast", function(){
$(this).before("<strong>Success! Your feedback has been sent, thanks :)</strong>");
setTimeout($.fancybox.close(), 1000);
// $('.fancybox').close();
// $.fancybox.close();
});
}
}
});
所有在截止正常工作APPART下,嘗試了各種變化,而不sucess。 以上超時給我 Error: useless setTimeout call (missing quotes around argument?)
,所以我都嘗試 setTimeout('$.fancybox.close()', 1000);
和 setTimeout("$.fancybox.close()", 1000);
,而我得到以下錯誤TypeError: $ is undefined
...幫助!
OK完美的感謝 – 2012-08-07 09:07:05