jQuery .load() with fadeIn effect

前端 未结 6 510
情话喂你
情话喂你 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 10:09

    Just this:

    $('.element').load('file.html',function(){}).hide().fadeIn();
    

    Or to add this behaviour as default in the load() function:

    $.fn.load_=$.fn.load;
    $.fn.load=function(){
        return $.fn.load_.apply(this,arguments).hide().fadeIn();
    }
    

提交回复
热议问题