javascript - My background doesn't fade in, just loads -
i have following javascript code:
$(document).ready(function () { $(window).load(function () { var images = ['image_1.jpg', 'image_2.jpg', 'image_3.jpg', 'image_4.jpg', 'image_5.jpg']; $('h1').fadein(2000, function () { $('body').fadein(3000, function () { $('body').css({ 'background-image': 'url(images/' + images[math.floor(math.random() * images.length)] + ')' }); }); }); }); });
link (let´s call a) site: https://dl.dropboxusercontent.com/u/46415927/index.html
the problem background not fade in after text. know solution this?
try
$('body').hide();
first, can't fade in that's being shown.
so:
$(document).ready(function () { $(window).load(function () { var images = ['image_1.jpg', 'image_2.jpg', 'image_3.jpg', 'image_4.jpg', 'image_5.jpg']; $('h1').fadein(2000, function () { $('body').hide().fadein(3000, function () { $('body').css({ 'background-image': 'url(images/' + images[math.floor(math.random() * images.length)] + ')' }); }); }); }); });
Comments
Post a Comment