Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
164
rated 0 times [  171] [ 7]  / answers: 1 / hits: 29648  / 13 Years ago, thu, may 12, 2011, 12:00:00

If I hide some elements on page_load using jquery, the elements flicker for a split second when the page posts and then disappear:



  function pageLoad() {

$('#panelOne').hide();
$('#panelTwo').hide();


Is there a way to prevent the flickering?



I don't want to set the elements css to visibility: hidden, because then calling the jquery .show() method later on doesn't seem to show the element.


More From » jquery

 Answers
35

Setting visibility: hidden doesn't work, but display: none does. See jsFiddle.



You could do this on the DOMReady event, but it would be cleaner to do it in CSS.


[#92263] Wednesday, May 11, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
daveon

Total Points: 749
Total Questions: 108
Total Answers: 87

Location: Malaysia
Member since Wed, May 11, 2022
2 Years ago
;