Is there any downside to using height: 0px; overflow: hidden; instead of display: none?
Is there any downside to using height: 0px; overflow: hidden; instead of display: none?
Share
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.
The
displayCSS property is built into a lot more methods, e.g..show()and.hide()for starters (among many others, for example you can’t just call.slideDown()anymore to show the element). Aside from that, most browsers optimizedisplay: nonebetter, if any parent hasdisplay: none;it need not render the element, so it can speed up things quite a bit ignoring these elements.More important than all of the jQuery parts: stepping back a minute from both a CSS and JavaScript standpoint, why not use the property provided explicitly for this purpose? 🙂