views:

180

answers:

4
+2  Q: 

Lock browsers

Hi,

I have a pretty simple question, but with an answer that I am unable to find. I was wondering if it is possible to lock a web browser (sticking with IE for now is fine) from being resized under (or past or smaller than) a certain set of dimensions.

For example, a new pop up window that starts at 500px by 500px, but can be enlarged to any size, but cannot shrink below 400px by 400px. So, when the user tries to go below these boundaries, the browser simply locks, not allowing the user to go any further.

A javascript/css/html solution would be preferred.

Thanks! Jaime

+1  A: 

Never tried it, but this site gives a pretty good overview of the technique.

Jacob B
+1  A: 

You may find this link to be useful. Essentially, he describes his issues with doing exactly what you're wanting to do. It SHOULD be simple; simply (within Javascript) trap the resize event, and check the size; if below the minimum size, force a resize to your minimum size. Sadly, it appears to not be that simple, but he describes a reasonable workaround.

McWafflestix
I think the key to this problem is setting the time out.So a follow up to this question is directly related to this problem:http://stackoverflow.com/questions/464679/access-is-denied-by-executing-hta-file-with-jscript-on-windows-xp-x64
Jaime
+1  A: 

Short answer: Not reliably.

Long answer: You might be able to, under certain circumstances, but many users will disable JavaScript window resizing and similar functionality.

Aric TenEyck
+1  A: 

Hi there,

What you require is not very user friendly but here is how you achieve this easily:

add the following function to your script tag :

function DonchaResizeThatThing() {
        window.resizeTo(550, 450);
    }

and then add the following event handler to your body tag

<body onresize="DonchaResizeThatThing();">

I hope this helps.

Ali