Having trouble adjusting background-size using jQuery? It seems to work with a single parameter, but not with two. I'm trying to set both width and height via jQuery variables.
Here's an example of my JavaScript code:
var w = 100;
var h = 100;
$("div").css("background-size", w + "px" + h + "px");
Check out the demo here:
This is just a basic example, in reality I need to pass two parameters to calculate the ratio.
Thank you!