Q:

jQuery fadein effect to transfer to another page

I am trying to set loading page and I set timeout to 5 seconds before moving to the index.html page.
I want to transfer to this page with some basic fade in transition and I would like to know how I can do this ?
My currently code is:
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title> Go Post - HomePage </title>
        <link rel="stylesheet" href="includes/style.css">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <script>
            setTimeout(function(){
                window.location='index.html';
            }, 3000);
        </script>
    </head>

    <body>
        <div class="load"></div>
    </body>
</html>

A:

You can simply do this by jquery fadeOut.
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title> Go Post - HomePage </title>
        <link rel="stylesheet" href="includes/style.css">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <!-- Import jquery -->
        <script src="//code.jquery.com/jquery-1.12.0.min.js"></script>
        <script>
            setTimeout(function(){
                $('html').fadeOut(
                    500,  // animation time
                    function(){
                        // action will do after the animation
                        window.location='index.html';  
                    }
                );
            }, 3000);
        </script>
    </head>

    <body>
        <div class="load"></div>
    </body>
</html>

