我正在和lightbox2一起做一个项目。不幸的是,每次我试着点击一张图片,把它装在灯箱里,盒子就会保持空白白色。
我检查了从Instagram加载的request..The图像是否正确。我的项目:
这是我请求的代码:
function getImages(searchText){
//removing the the last images of the search if there were any
$("img").remove();
//making the ajax call
$.ajax({
type: "GET",
dataType: "jsonp",
cache: false,
url: "https://api.instagram.com/v1/tags/"+searchText+"/media/recent?access_token=HEREISMYTOKEN",
success: function(data) {
for (var i=0; i <= 6; i++) {
var image = data.data[i].images.standard_resolution.url
$("#images").append("<a href='"+image+"' rel='lightbox[insta]' title='Alternately you can press the right arrow key.' ><img src="+data.data[i].images.thumbnail.url+" alt='Plants: image 2 0f 4 thumb' /></a>")
Lightbox.initialize();
};
}
});
}有什么办法解决这个问题吗?非常感谢!
发布于 2012-07-30 07:33:10
我已经发现了你的问题后,研究如何照明箱工作。
默认情况下,有<img class="lb-image">的lightbox。
调用getImages(searchText)函数之后,由于下面的函数,它将被删除:
$("img").remove();您应该详细指定要删除哪个img。这应该能解决你的问题。
https://stackoverflow.com/questions/11715998
复制相似问题