开发者

capture browser restore option

开发者 https://www.devze.com 2022-12-24 09:38 出处:网络
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 th

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号