[英]force maximum browser size on page load
I'm wondering if it is at all possible to use JavaScript to detect if the user's browser is minimized (not completely minimized -- just reduced size to smaller then maximize) at all, and if it is then > force full screen > upon page load of website.我想知道是否有可能使用 JavaScript 来检测用户的浏览器是否被最小化(不是完全最小化 - 只是将尺寸缩小到更小然后最大化) ,如果它是然后 > 强制全屏> 在页面上网站的负载。
$( document ).ready(function() {
if (smaller then max screen) {
screen = 100%; // general idea
});
Yes it is possible to detect change of size, here's how to do it,using jQuery:是的,可以检测大小的变化,这里是如何做到这一点,使用 jQuery:
$(window).resize(function() {
//...
});
And here's how to maximize the browser window :以下是最大化浏览器窗口的方法:
window.moveTo(0, 0);
window.resizeTo(screen.availWidth, screen.availHeight);
But really, I would not encourage it, as it's better that the user controls the browsing experience.但实际上,我不鼓励这样做,因为用户控制浏览体验会更好。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.