Hi,

I want to disable resize of popup window. I am using following code but this is not working in any browser.

My Code::

window.open(url,'POPUP', "width=360,height=400,toolbar=no,directories=no,menubar=no,status=no,resizable=no,scrollbars=no");

And when i m using <BODY Onload='noresize'>.
This code working in only in IE not in mozilla.

Please help me

Thanks in advance

Pankaj

Dani AI

Generated

— short answer: modern browsers will not reliably let a page lock the user’s window size. ’s suggestion to switch the feature values isn’t the root problem, and ’s link points at older hacks that browsers have largely stopped honoring. Browsers intentionally give the user control (and often convert scripted popups into tabs), so attempts to “force” a non‑resizable native window are best treated as best‑effort and not guaranteed.

Because this is browser behavior, the practical approach is to stop trying to control the chrome and instead control the content. Two safe options that work consistently across browsers and years later:

  • Use an in‑page modal or the HTML5 <dialog> element so the UI appears as a fixed popup but sits inside the page (cannot be resized as a separate window).
  • Make the popup content responsive (set sensible min/max widths, use flexible layout) so resizing doesn’t break the UI.

A minimal in‑page fixed-size modal example:

<button id="openBtn">Open</button>

<div id="overlay" style="display:none;position:fixed;inset:0;background:rgba(0,0,0,.5)"></div>

<div id="modal" style="display:none;position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);
  width:360px;height:400px;background:#fff;padding:12px;box-shadow:0 6px 24px rgba(0,0,0,.3)">
  <button id="closeBtn">Close</button>
  <div>Fixed-size content goes here</div>
</div>

<script>
document.getElementById('openBtn').onclick = () => {
  document.getElementById('overlay').style.display = 'block';
  document.getElementById('modal').style.display = 'block';
};
document.getElementById('closeBtn').onclick = () => {
  document.getElementById('overlay').style.display = 'none';
  document.getElementById('modal').style.display = 'none';
};
</script>

Notes: avoid hacks that rely on browser bugs; prefer accessibility (allow zoom/keyboard focus); and test the approach across browsers and with pop‑up blockers.

I say instead of setting yes/no , try to set it by true/false.

========================================================================================

Hi,

I want to disable resize of popup window. I am using following code but this is not working in any browser.

My Code::

window.open(url,'POPUP', "width=360,height=400,toolbar=no,directories=no,menubar=no,status=no,resizable=no,scrollbars=no");

And when i m using <BODY Onload='noresize'>.
This code working in only in IE not in mozilla.

Please help me

Thanks in advance

Pankaj

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.