44
rated 0 times
[
50]
[
6]
/ answers: 1 / hits: 22990
/ 13 Years ago, sun, december 11, 2011, 12:00:00
Weird little snafu. I'm using jQuery's .css()
method to change the size of text (long story; no, I can't use media queries) using a variable and I need to add em
to it. I'm not sure what the syntax is because there are multiple values for the CSS change.
To illustrate:
This works perfectly. It adds em
to the calculated value of victore
:
$('h1').css('font-size', victore + 'em');
This doesn't:
$('h1').css({
'font-size':victore + 'em',
'line-height':vignelli + 'em';
});
The em
needs quotes... but so does the value. Wrapping it in parens didn't work
More From » jquery