How I can capture browser restore/maximize event in jQuery or javascript? We can use window.onresize but tha开发者_C百科t only tells that the browser is resized. thanks!
There is no way to determine this on script level.
You could - as a very unreliable workaround - compare the window.width
and document.clientWidth
properties after a resize
event and see whether they match, or almost match. If they do, it's possible a maximize
action has taken place.
I think it won't get any better than that, and even this method is subject to many, many factors. If there is a vertical toolbar, preventing the browser from resizing to the screen's full width, the values will differ, making it harder and harder to determine a resize event.
精彩评论