Reputation: 4103
I have a problem that I want to disable the maximize button of the browser when we run our web application, means user can not maximize the same browser screen in which site is running. I don't know how it will be achieved? Please suggest me the right solution regarding the same.
Thanks in advance.
Upvotes: 0
Views: 8774
Reputation: 739
<body onresize="window.resizeTo(350,530)">
<form id="form1" runat="server">
</form>
</body>
Upvotes: 0
Reputation: 4469
By default, max button of a window is enabled, but if you open as pop-up and pass some value as the window property in that case the max button might be disabled, please see below way to do this job:
Set window resizable
property as either no
or 0
.
Format:
window.open("pageurl","PopupWindow","resizable=no"); //OR: resizable=0
Examples:
window.open("http://www.google.com","PopupWindow","resizable=0");
window.open("http://domainname.com/somepage.ext","PopupWindow","resizable=0");
window.open("http://domainname.com/somepage.ext","PopupWindow","resizable=no");
Upvotes: 1
Reputation: 4992
You'll need to open your target page in a popup window with the resizable attribute set to "no." This cannot be modified on the active page. You will be required to launch a popup window in order to disable maximize. For instance:
function onReady() {
window.open("http://www.contoso.com","myWindow","resizable=no");
}
Upvotes: 1
Reputation: 13213
You can re-load the window that way using window.open() (javascript)
<script>
function openWithoutResize(url,target) {
window.open(url,target,"resizable=0");
}
</script>
Upvotes: 1