I know how to delay an element on load, but I have a weird request from a client. They want the background image to load 5 seconds after the page loads. I'm new to js, thought I could do it easily, but it's not working out.
I've tried this:
$(document).ready(function() {
$('#primary .bcg').css( "background", "url(folder/path", function(){
$(this).delay(5000).fadeIn(400)
});
});
and this:
$(document).ready(function() {
$('#primary .bcg').delay(5000).fadeIn(400, function() {
$('this').css( "background", "url(folder/path")
});
});
Both to no avail. Is there a way to make this happen? Or rather a way for a novice to make it happen?
css:
#primary .bcg {
background: none;
background-attachment: fixed;
background-position: center center;
background-repeat: no-repeat;
background-size: cover;
}
Much thanks for any help!