4

ajaxを使用してhtmlをフェードインしてロードしようとしています。ロードされますが、フェードなしで、何が間違っているのかわかりません。これが私のコードです。

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

エラーが発生します、私の間違いは何ですか?

4

2 に答える 2

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

する必要があります

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

;の変更と移動に注意,してください)

于 2012-10-12T12:20:02.730 に答える
3

おそらくあなたは意味します:

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

これは#content、AJAXロードの前にが表示されていない場合にのみ機能します。

于 2012-10-12T12:20:28.770 に答える