Reputation: 474
I am trying to make my homepage consistently have a fade in effect when this loads. however, it only works part of the time. This is the current script I am using. I set it to html, since individual div elements didn't seem to work, but setting it to html does and doesn't.
$(document).ready(function () { $('html').hide().fadeIn(1500).delay(6000)});
Upvotes: 1
Views: 19000
Reputation: 139
Check out some Loading effect at CODROPS Article .. u may find it useful http://tympanus.net/codrops/2013/09/18/creative-loading-effects/
Upvotes: 2
Reputation: 37
Try the below code. It will work:
Set ur body first:
<body>
This is my page
</body>
Now the jQuery:
$(document).ready(function(){$("body").hide().fadeIn(1000);});
Upvotes: 2
Reputation: 15924
It won't work if the page loads too slow.
Maybe a lot of images(large photos), scripts etc.
Or just because the slow internet connection.
Upvotes: 0
Reputation: 474
set to priority before other scripts.
$(document).ready(function () { $('body').hide().fadeIn(1500).delay(6000)});
Upvotes: 2