Work around for live filtering 1500+ items with jQuery in Chrome

后端 未结 2 785
醉话见心
醉话见心 2021-02-09 00:48

I\'m being bitten by the Chrome/Webkit 71305 bug where un-hiding a large number of nodes causes Chrome to hang. (Also occurs in Safari).

I am filtering a list item that

2条回答
  •  忘掉有多难
    2021-02-09 00:59

    Have you tried other css possibility for hiding the elements?

    Using css props like a switch of visibility? Or a switch between height:auto and height:0;overflow-y:hidden;?

    I made a little example here, it's using .css({"visibility":"visible","height":"auto"}); to show and ({"visibility":"hidden","height":"0"}) to hide. And it seems to work fine in chrome in the few test I did.

    EDIT: Even better here , you just have to use .css("visibility","visible"); and .css("visibility","hidden");. The use of li[style~="hidden;"]{height:0;} is doing the height modification for you.

提交回复
热议问题