javascript - dynamic max-height with js in firefox -
i cannot alter max-height value of div in javascript. can give me hints. works in chrome, safari, , ie not in firefox. there way work in ff?
<div id='box'> lot of text<br/> lot of text<br/> </div> #box { max-height: 10px; overflow: hidden; } $('box').setstyle({'max-height': '100px'})
according prototypejs documentation need use camelized version of style
so instead of
$('box').setstyle({'max-height': '100px'});
it should be
$('box').setstyle({'maxheight': '100px'});
this fiddle shows working in firefox 20 http://jsfiddle.net/4k7rk/6/
Comments
Post a Comment