淡入淡出的Ajax加载 [英] Ajax Load with fade in

查看:93
本文介绍了淡入淡出的Ajax加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用带有ajax的html加载淡入淡出。加载但没有褪色,我不知道我做错了什么,这是我的代码:

i'm trying to load with a fade in an html with ajax. It loads but with no fade, I don't know what i'm doing wrong, here it's my code:

$("#artworks").click(function(){
// load artworks page
    $("#content").load("artworks.html"); function(){
    $(this).fadeIn("slow");
    });
});

它得到一个错误,我的错误是什么?

it get's an error, what's my mistake?

推荐答案

$("#artworks").click(function(){
    $("#content").load("artworks.html"); function(){
    $(this).fadeIn("slow");
    });
});

应该

$("#artworks").click(function(){
    $("#content").load("artworks.html", function(){
      $(this).fadeIn("slow");
    });
});

注意更改; TO 的运动)

NOTE THE CHANGE OF ; TO , AND THE MOVEMENT OF THE )

这篇关于淡入淡出的Ajax加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆