slideToggle issue in jQuery -


I have a table with thousands of records (div element). Each Div click is enabled and when I click on each record, a divide slide under the clicked divide appears using the toggle.

Because the number of records is too much, the effect of the slidestag is not desired. The desired one just shows the div instead of the sliding.

I have the following event handler code

  $ ("div.opendiv"). Click (function () {var Openelem = $ (this) .next (); openelem.slideToggle ();});  

I do not want to divide these records into pages.

Can I do that the slidetag effect will be smooth?

Thanks

Since you are toggling an element between thousands, All browsers will see this interval something else compared to others, it is related to memory usage by browser and version, but it is also related to user machine. Obviously, better machines can manipulate more DOM elements.

So, to help you, I made a bela with a workbook:

The idea is: If the size of the parents is fixed, hair sliding will suppress the animation , because it only element to be animated Therefore, I updated my code to set the parent height before slideing the child div .

For the 500/1000 range, 10000, 50000 ... it may be a moment that your browser can not animate more. And maybe any page will crash before showing ...

In my tests, the animation is smooth with about 30 thousand td elements, so that in some cases your idea Will solve the problem.

But I really believe in better options if you do not want to divide this page into several pages: Act as a tab with some devices , in it a few hundred TDS Show and hide About > Display: Any children of parents with no children are not on animation and will not let them fall.


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -