Forcing windows resize to fire

后端 未结 6 1200
[愿得一人]
[愿得一人] 2020-12-14 15:57

I have problems with my layout, when I re-size window manually and restore it to normal everything is in the perfect place.

Is it possible to trick the browser and

6条回答
  •  死守一世寂寞
    2020-12-14 16:29

    toggle the display attribute on the areas that need to be redrawn. for example:

    var toDraw = document.getElementById('redrawme');
    toDraw.style.display = none;
    toDraw.style.display = '';
    

    I dont know whqt the result would be if you tried to do the entire body element as ive never tired it before.

    What are you doing that you need to force a redraw?

提交回复
热议问题