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

后端 未结 2 780
醉话见心
醉话见心 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.

    0 讨论(0)
  • 2021-02-09 01:07

    Actualy, you can put empty value to <li> element. That actualy is only fix i was able to work. And when you need value again, put it back. Or you can remove <li>. But I more prefere for that, to use AJAX.

    0 讨论(0)
提交回复
热议问题