Sunday, March 17, 2013

Using style.display instead of style.visibility

Hello,

HTML-CSS-JavaScript combination is little bit tricky to non-web developers.

There are few UIs which seems to be inconsistent as we are using JavaScript to enable/disable the HTML Components.
And it takes time to find out and align all the forms.
If you are using any JavaScript and CSS combination to hide/show any components, below information may save your time. 


To maintain proper alignment of whole HTML and its elements, please use following:
Element Property
Value
style.display
'none' (To hide element)
style.display
'' (Empty string to show element)


Please try to avoid using style.display='block' and style.visibility='hidden'/'visible'/'inline' as it is affecting the CSS applied.

---
Cheers and Enjoy Scripting!
-------------------------------------------------------------------------
Alphabet 'O' stands for Opportunity,
Which is absent in 'Yesterday', Is available once in 'Today'
And thrice in 'Tomorrow' So don't think about 'Yesterday'.
-------------------------------------------------------------------------

No comments: