AJax 加载动画脚本
拜托,我无法让这个脚本工作
function Display_Load()
{
$("#loading").fadeIn(900,0);
$("#loading").html('<img src="../images/loadinganimation.gif" />');
}
//Hide Loading Image
function Hide_Load()
{
$("#loading").fadeOut('slow');
};
//Pagination Click
$("#pagination-flickr li").click(function(){
Display_Load();
});
-------
<ul class="pagination-flickr">
<li>some data to click</li>
</ul>
<div id="loading"></div>
Please I can't get this script to work
function Display_Load()
{
$("#loading").fadeIn(900,0);
$("#loading").html('<img src="../images/loadinganimation.gif" />');
}
//Hide Loading Image
function Hide_Load()
{
$("#loading").fadeOut('slow');
};
//Pagination Click
$("#pagination-flickr li").click(function(){
Display_Load();
});
-------
<ul class="pagination-flickr">
<li>some data to click</li>
</ul>
<div id="loading"></div>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您的点击处理程序是 ref 和 id
#pagination-flickr
,而您的是
.pagination-flickr
的类jsfiddle 上的代码示例。
Your click handler is ref and id
#pagination-flickr
while your<ul/>
is a class of.pagination-flickr
Code example on jsfiddle.
只是猜测:您希望仅在图像可用后才开始淡入?试试这个:
如果问题是您希望图像在加载内容之前显示,那么问题是调用“fadeIn”将导致
Just a guess: you want the fade-in to start only after the image is available? Try this:
If the issue is that you want the image to show up before the content is loaded, then the problem is that the call to "fadeIn" will cause the
<div>
to be made invisible before it's made visible. In other words, the first thing "fadeIn" does is to hide the element so that it can actually "fade in" to view.