How do you make an html page fade out while another fades in?

前端 未结 9 2047
野性不改
野性不改 2020-12-17 19:42

I have a client with an event planning site asking his pages to fade into one another. I have no idea how I can accomplish this. Any ideas? Is there anyway to do this withou

9条回答
  •  余生分开走
    2020-12-17 20:01

    You could load the content using an AJAX request and then use javascript to fade out one page and fade in the other? In jQuery, something along the lines of:

    $.get('newpage.html', {}, function(res){
        $('#content-container').fadeOut().html(res).fadeIn();
    });
    

    Not perfect, but it's a move in the right direction hopefully? This isn't really something HTML was made for...

    Thanks, Joe

提交回复
热议问题