Having just started out, I'm having trouble understanding why my code won't properly execute the following:
var h = $( window ).height();
$('.bg').css({
'height' : h,
'background-size' : "auto" + h
})
Specifically, the background-size property is not changing. The height adjustment works perfectly fine, but I want the background-size to appear like this: background-size: auto 900px (if the height is measured to be 900px).
Am I overlooking something here?
Thank you in advance.
It seems the solution below worked, but I did need to include the 'px' after the 'h':
"background-size" : "auto " + h + "px"
Thank you so much!!!