问题
I am trying to increase the font size within a page and therefore also adjust the line height accordingly. Now I saw that I can use relative values for the font-size, but somehow this doesn't work for the line-height!?
$('elem').on('click', function () {
box.animate({
'lineHeight': '+=5',
'fontSize': '+=5'
});
});
Is there another way then:
var lh = parseFloat( box.css('line-height'), 10);
$('elem').on('click', function () {
lh += 5;
box.animate({
'lineHeight': lh + 'px',
'fontSize': '+=5'
});
});
?
thanks
来源:https://stackoverflow.com/questions/9840983/jquery-animate-lineheight-relative-property-gives-weird-result