JQuery. Hide elements before they rendered. Best practice
Posted
by Andrew Florko
on Stack Overflow
See other posts from Stack Overflow
or by Andrew Florko
Published on 2010-05-10T07:38:10Z
Indexed on
2010/05/10
7:44 UTC
Read the original article
Hit count: 325
Hello everybody,
I want to generate html layout with areas (divs, spans) that can be shown/hidden conditionally. These areas are hidden by default.
If I call .hide method with jquery on document.ready these areas may blink (browsers render partially loaded documents). So I apply "display: none" style in html layout.
I wonder what is the best practice to avoid blinking, because applying "display:none" breaks incapsulation rule - I know what jquery does with hide/show and use it. If jquery's hiding/showing implementation will change one day, I'll get the whole site unworkable.
Thank you in advance
© Stack Overflow or respective owner