I have a div, maximum width for div is user defined. I know I can get it done using element.style.height but this doesn,t work in IE.
Any Idea how can I implement max-height equivalent of firefox by using javascript.
I have a div, maximum width for div is user defined. I know I can get it done using element.style.height but this doesn,t work in IE.
Any Idea how can I implement max-height equivalent of firefox by using javascript.
document.getElementById ( "yourelementid" ).style.maxHeight = "100px";
maxHeight was introduced in Windows Internet Explorer 7
Usually style attribute names are translated into javascript property names by removing the hyphens and camelcase the name instead.
So background-color
becomes backgroundColor
, text-align
becomes textAlign
and max-height
becomes maxHeight
.
You can set an element el
's maximum height to mHeight
by:
el.style.maxHeight=mHeight;
Remember to use a valid value for mHeight
.