I have a div, and the maximum width for this div is user defined. I know I can get it done using element.style.height but this doesn’t work in IE.
Any ideas on how to implement the max-height equivalent of Firefox by using javascript?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Usually style attribute names are translated into javascript property names by removing the hyphens and camelcase the name instead.
So
background-colorbecomesbackgroundColor,text-alignbecomestextAlignandmax-heightbecomesmaxHeight.You can set an element
el‘s maximum height tomHeightby:el.style.maxHeight=mHeight;Remember to use a valid value for
mHeight.