(обновление: добавлена эта первая часть) Загружает все встраиваемые изображения , затем рекурсивно затухает все каждые полсекунды, затем выдает предупреждение (замените концепцией, которую вы прокомментировали)
var selector = "ul li:hidden:first";
function fadeIn($item) {
$item.fadeIn(500,function() {
var n = $(selector);
if(n.length > 0) {
fadeIn($(selector));
} else {
// add a div
alert("added a div");
}
})
}
$(document).ready(function() {
// load images first
var imgs = []; // cached
$("ul li img").each(function() {
// create a separate img tag because img is not active due do [assumed css] display:none;
var cacheImage = document.createElement('img');
cacheImage.src = $(this).attr("src");
imgs.push(cacheImage);
});
// this is a quick method, you can change window to the image nodes to optimize better
$(window).load(function() {
fadeIn($(selector));
});
});
Источник: http://jsfiddle.net/MattLo/ukLaG/1/ (для проверки используется очень большое изображение)