我有一個功能,將打印出一些文字,而一個iframe加載內容:更多效果,一個功能。 jQuery的
// set "waiting" message:
$("#loadingStatus").html("Waiting for your advertisements to load...");
我的問題是,我怎麼添加淡入(「慢」)上面加載消息? 我試着在同一行中添加.fadeIn(「slow」),但那不起作用。
我有一個功能,將打印出一些文字,而一個iframe加載內容:更多效果,一個功能。 jQuery的
// set "waiting" message:
$("#loadingStatus").html("Waiting for your advertisements to load...");
我的問題是,我怎麼添加淡入(「慢」)上面加載消息? 我試着在同一行中添加.fadeIn(「slow」),但那不起作用。
你可能必須先隱藏自己的元素,因爲fadeIn()什麼都不會做,如果該元素已經可見:
$("#loadingStatus").hide().html("Waiting for your advertisements to load...")
.fadeIn("slow");
這個伎倆!如果我想在iframe上使用fadeIn()函數呢? –
你應該沒有問題調用'
這似乎並不奏效:$(「#iFrame」)。fadeIn(「slow」); –
隱藏它首先:
$("#loadingStatus").hide().html("Waiting for your advertisements to load...").fadeIn("slow");
你可以做的是,先將#loadingStatus
淡出/隱藏,然後添加html,然後再次淡入,如下所示:
$('#loadingStatus').hide().html('Your message here').fadeIn('slow');
你的#loadingStatus最初是隱藏的嗎? –