嘿即時通訊新的jQuery的,我希望我的頭銜是有意義的:P。我需要在這個循環中的停頓,直到數組中的上iframe是準備好之前,下一個獲得爲src。這裏是我的一些代碼,我認爲它相當接近但缺少一些東西。jQuery的暫停準備
enter code here
var url = [
"http://www.stuff.co.nz/" ,
"http://www.metservice.com/marine-surf/tides/nelson"
];
$(function()
{
$("iframe").each(function(index)
{
if (index == 0)
{
$(this).attr('src', url[index]);
}
$(this).ready()
{
$(this).attr('src', url[index]);
}
});
});
你無法控制時,一個iFrame負載。這是不可能的。 – Alvaro
替換此代碼塊'$(本)。就緒() { $(本).attr( 'src' 中,URL [指數]); }''與$(本)。就緒(函數(){$ (本).attr( 'src' 中,URL [指數]); }); '做每個循環中遞增'index' – dreamweiver