祝大家早安,
我有异步 ajax 加载的问题....
我已经完成了一个动态画廊,我想在页面加载后加载图像。
但是当我尝试淡入图像并淡出微调器时,唯一似乎完美消失的是最后一个元素..为什么?
我能做什么?谢谢!
.js 文件
$('.Home-Image').each(function(index) {
MyHolder = $(this).children(".Home-Image-Holder");
MyLoader = $(this).children(".Home-Image-Loader");
IDIMG = $(MyHolder).attr("AjaxRel");
$(MyHolder).load('<?PHP echo($ABS); ?>/inl/components/AjaxImageHome.php?ABS=<?PHP echo $ABS; ?>&IDIMG='+IDIMG, function()
{
MyLoader.fadeOut(250,0,function(){MyHolder.fadeIn();});
});
});
html文件
<div class="Home-Image">
<div class="Home-Image-Loader"></div>
<div class="Home-Image-Holder" AjaxRel="1"></div>
</div>
<div class="Home-Image">
<div class="Home-Image-Loader"></div>
<div class="Home-Image-Holder" AjaxRel="2"></div>
</div>
<div class="Home-Image">
<div class="Home-Image-Loader"></div>
<div class="Home-Image-Holder" AjaxRel="3"></div>
</div>
<div class="Home-Image">
<div class="Home-Image-Loader"></div>
<div class="Home-Image-Holder" AjaxRel="4"></div>
</div>