I've been struggling with this for the past six hours and can't seem to get it right. I've checked out various solutions on Stack Overflow, but nothing seems to work. What am I missing here?!?
My html5 page doesn't have a background and in my JavaScript code, I'm trying to initialize the landing page like this:
/*
* Initializes the landing page.
*/
function initializeLanding(){
$('body').css({
'backround':'url("http://40.media.tumblr.com/290e7a272b492735ddf8cd968e657d05/tumblr_nhmg6xYnv41u7ns0go1_1280.jpg")'
});
}
It should be a simple fix, yet I'm completely stuck. I've experimented with different types of quotes and attributes, but nothing has worked so far. I'd prefer not to use CSS or DOM properties to change the background because I need the background to change at specific points as the user scrolls down.
Also, if I add new attributes using the .css() method, will it overwrite all the old ones or just append the latest changes?
Update: This is where I call the function:
var main = function(){
$(".owl-carousel").owlCarousel();
lorem();
initializeLanding();
}
$(document).ready(main);