css display:none runs slow

konstantinosmap

New Member
I have a page that has a very long \[code\]<ul>\[/code\] containing maybe a couple of thousand \[code\]<li>\[/code\]. I am using AJAX to change the style of each \[code\]<li>\[/code\] to determine if it displays or not using the css attribute:\[code\]<li style="display: <?php echo $show ?>"> my_item </li>\[/code\]where $show can be either 'none' or ''.The page loads fine if all of the $show variables are set to '', but takes a long time (2 minutes in chrome and 20 seconds in explorer) to load when all of the $show variables are set to 'none'. I've also tried changing the class of each \[code\]<li>\[/code\] and using two different external css classes and still the 'none' option loads very slow compared to the '' option. In the real application I will have a mixture of '' and 'none' that I want to be able to change via AJAX. Can anyone shed any light on this situation? Is this an inherent limitation of display:none?
 
Back
Top