Last Updated: September 09, 2019
·
35.7K
· codesbyaxel

Fade in page on load

With this simple jQuery-code you can fade in your website on load. By default, the fading-process is set to 500 milliseconds, but you can change this to whatever suits your needs.

$(document).ready(function(){

/*! Fades in page on load */
$('body').css('display', 'none');
$('body').fadeIn(500);

});

3 Responses
Add your response

Yeeeeeeah!

over 1 year ago ·

Chain :)

$('body').css('display', 'none').fadeIn(500);

over 1 year ago ·

<body style="display:none;"> </body> is good but what if user dont have javascript enabled ?

over 1 year ago ·

Have a fresh tip? Share with Coderwall community!

Post
Post a tip
Did you know?

JavaScript on a page runs with the privileges of that origin. One altered library, tag manager, or snippet can read inputs, change what people see, and call your APIs as the user.

Security insights from Cside