jQuery .load() with fadeIn effect

前端 未结 6 504
情话喂你
情话喂你 2020-12-06 09:27

I\'m trying to load #content of a url via AJAX using jQuery within #primary. It loads but doesn\'t fadeIn. What am I doing wrong?

$(\'.menu a\').live(\'clic         


        
6条回答
  •  臣服心动
    2020-12-06 09:58

    This is the best way to fade in/out it naturaly, first you hide your container then you load your page in this container (it will be loaded but hidden) then just use the Jquery function .fadeIn() and it will unhide it adding the special effect.

    $(".myClass").click(function () 
    {
        $("#Container").hide();
        $("#Container").load("magasin.html");
        $("#Container").fadeIn(); 
    });
    

提交回复
热议问题