我用xml动态加载图片,追加到div中,但是这个时候,jquery的图片插件就不起效果,但是我在加载完成以后alert("1")随便一个东西,效果就出来了,这个是为什么要怎么解决这个问题
indexpcshow()是动态加载图片的方法,有了alert("1");效果出来了。没有alert("1");没效果。谢谢大侠们帮助解决下
$(function() {
indexpcshow();
alert("1");
$(".scrollable").scrollable();
$(".items img").click(function() {
if ($(this).hasClass("active")) { return; }
var url = $(this).attr("src").replace("s", "l");
var wrap = $("#image_wrap").fadeTo("medium", 0.5);
var img = new Image();
img.onload = function() {
wrap.fadeTo("fast", 1);
wrap.find("img").attr("src", url);
};
// begin loading the image from www.flickr.com
img.src = url;
// activate item
$(".items img").removeClass("active");
$(this).addClass("active");
// when page loads simulate a "click" on the first image
}).filter(":first").click();
});
});