I need to set the background size via JS. This is my current CSS code that does what I need (set size % seamlessly based on orientation)
background-size: 50%;
@media all and (orientation:landscape) {
background-size: auto 50%;
}
I would need to change both instances of the 50% value in above's code. Right now I have this
element.css("background-size", foo.toFixed(0) + '%');
This works but discards the media query. How can this be solved?