Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Extremely slow performance of hide/show function when dealing with large number of elements

I am experiencing terrible performance when I'm doing $("#myDiv").show() and $("#myDiv").hide() only in Safari and Chrome on a Mac, all other browsers including IE6 are working fine on PC and Mac, so this is a Webkit issue.

The div "myDiv" contains a large number of elements, including lots of checkboxes, JqueryUI tabs, and 3 sliders.

I tried "addClass" instead of show/hide, I tried setting margin to -10000 and back to 0 and none of these things seem to help. Is there a work around or is this a limitation of these browsers?

like image 221
Greg R Avatar asked Apr 05 '11 17:04

Greg R


1 Answers

Ok, I do apologize for this, but this is mind blowing....

After solid 50 JS tweaks with no avail, it turns out that my problem was in CSS!!!

After wasting a day on this, turns out that "background-size: 100%;" crashes webkit! That's insane... Removing that one line removed all of my crashes.

Again, very sorry for reporting the wrong issue.

like image 89
Greg R Avatar answered Sep 21 '22 00:09

Greg R