FadeOut Ajax Response FadeIn
As the subject says, I want to fade out my current content, add my ajax response content and fadeIn my content.
This is what I have
- $("#page-content").fadeOut(2000).html(result).fadeIn(2000);
What's happening is my AJAX response is showing then it's fading out and in.
Here is my full code
- $(document).on("click","#news-btn",function(e){
- $.ajax({url: "getContent/news.php", success: function(result){
- $("#page-content").fadeOut(2000).html(result).fadeIn(2000);
- }});
- });