JQuery UI modal dialog uses 100% CPU

2019-03-28 05:58发布

When I have a modal JQuery dialog open in IE8, my CPU usage goes to 100% (no, actually 50, but that's 100% of one core). If I break developer tools, it seems that it's a lot of resize events firing (I don't do any volontary resizing). Has someone else encountered this issue and knows how to fix it?

3条回答
Emotional °昔
2楼-- · 2019-03-28 06:06

I've seen things like this happen when something is filling a container at 100% width and height, and that container has overflow:auto. Which makes it bounce back and forth endlessly trying to fit in the container, but then the container adds or removes scrollbars. Don't know if this is applicable to your situation, but maybe something similar.

查看更多
你好瞎i
3楼-- · 2019-03-28 06:08

I had a similar issue, IE was firing the windowResize event many times per second and maxing out the client CPU. The fix detailed here worked perfectly: http://www.frebsite.nl/projects/windowresizefix/

查看更多
唯我独甜
4楼-- · 2019-03-28 06:19

The solution is to add this to your CSS file:

.ui-widget-overlay {
   position: fixed;
}

reference

查看更多
登录 后发表回答