Jquery fadeIn()-Firefox中闪烁的图像

Jquery fadeIn()-Firefox中闪烁的图像,jquery,Jquery,演示站点:http://83.249.244.210:8080/img/ 尝试在Firefox中刷新站点几次。当图像淡入时,其中一些会闪烁一点。谁能解释一下原因吗 这是我加载图像的方式: $(function(){ $.post('service.php?getPhotos', function(data){ var loadCount = 0; $.each(data, function(){

演示站点:
http://83.249.244.210:8080/img/

尝试在Firefox中刷新站点几次。当图像淡入时,其中一些会闪烁一点。谁能解释一下原因吗

这是我加载图像的方式:

$(function(){

        $.post('service.php?getPhotos', function(data){

            var loadCount = 0;

            $.each(data, function(){

                $.post('service.php?getImage', { id: this.id }, function(data2){

                    loadCount++;

                    var $galleryItem = $('<div/>')
                        .hide()
                        .attr({ 'class': 'galleryItem' })
                        .html('<a href="'+ data2.photo.id +'"><img src="http://farm'+ data2.photo.farm +'.staticflickr.com/'+ data2.photo.server +'/'+ data2.photo.id +'_'+ data2.photo.secret + '_q.jpg"/></a><h3>'+ data2.photo.title._content +'</h3><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent euismod ultrices ante, ac laoreet nulla vestibulum adipiscing.</p>');

                    $('#container').append($galleryItem); 

                    $galleryItem.find('img').load(function(){

                        $galleryItem.fadeIn(200);
                    });

                });

            });
        });

    });
$(函数(){
$.post('service.php?getPhotos',函数(数据){
var loadCount=0;
$.each(数据,函数(){
$.post('service.php?getImage',{id:this.id},函数(data2){
loadCount++;
变量$galleryItem=$('')
.hide()
.attr({'class':'galleryItem'})
.html(“”+data2.photo.title._content+”Lorem ipsum dolor sit amet,Concetetur adipiscing Elite.Praesent euismod ultrices ante,ac laoreet nulla门厅adipiscing.

'); $(“#容器”).append($galleryItem); $galleryItem.find('img').load(函数(){ $galleryItem.fadeIn(200); }); }); }); }); });
也许在jQuery淡入之前尝试用css隐藏图像

#container > div {
    display: none;
}

我没有看到任何“闪烁”,我确实看到了在我看来像是暂停中的
fadeIn()
。“这就是你指的吗?”贾里德:是的,停顿一下,或者眨眼。不知道该怎么称呼它:)因为你在别处评论说你认为它可能与css有关,所以你可能会编辑你的问题并包含这些信息。恐怕结果是一样的。多谢了,如果这有什么安慰的话,它在Firefox 13.0.1(Mac OS)上运行得很好,可能是img标签存在,但浏览器在尝试淡入之前没有从flickr中检索图像本身?i、 e.当img标记存在或img从flickr完全下载时,是否调用load?它已被检索并完全加载到load函数内的浏览器中。我不确定它是否会更改任何内容,但您只需将事件绑定一次到“load”。i、 您的代码可能看起来像
$('#container img').on('load',function(){$(this.parent().fadeIn(200);})