gpt4 book ai didi

jquery - jquery 中的 .load() 和 .fadeIn

转载 作者:行者123 更新时间:2023-12-01 01:39:27 25 4
gpt4 key购买 nike

我有这段代码,除了淡入过渡之外,它可以工作。

$("div.thumbnailsContainer").fadeOut("500",function(){            
$("div.fullViewContainer").empty();
$('<img />')
.attr('src', imgPathLarge)
.load(function(){
$("div.fullViewContainer").append( $(this) );
$("div.fullViewContainer").fadeIn("1000");
});
});

问题是,图像完全加载后,fadeIn 过渡将无法正常工作,它只会在加载后出现,但没有过渡..

我的代码可能有什么问题?

我需要设置 setTimeout 来延迟图像加载后的转换吗?

最佳答案

尝试先隐藏图像,然后在 load() 处理程序中调用 fadeIn。

参见:jquery: fade in image after image

关于jquery - jquery 中的 .load() 和 .fadeIn,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3256492/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com