PDA

View Full Version : resize and center window? in IE7



peejeno
01-15-2007, 12:28 AM
hello all, i have this script thanks to DimX,

<script language="JavaScript">
function resizeAndCenter(width, height) {
window.resizeTo(width, height);
window.moveTo((screen.availWidth-width)/2, (screen.availHeight-height)/2);
}

resizeAndCenter(400, 300);
</script>

and it works great in ie6 but does not in ie7.

can any one help?, thanks :confused: :confused:

tech_support
01-15-2007, 01:12 AM
Works fine in IE7 for me.

Are you viewing it on a saved location on your desktop (Not online, or on localhost)? You'll need to "Enable Blocked Content" before viewing.

peejeno
01-16-2007, 02:56 AM
how do i do that?
and why? will my users have to do that before looking at the site, or is there away to get around it?
thanks
-p

thetestingsite
01-16-2007, 03:01 AM
how do i do that?
and why? will my users have to do that before looking at the site, or is there away to get around it?
thanks
-p

If you are viewing the page by simply opening the saved file from let's say your desktop, a popup will appear saying something like "Intranet settings have been enabled, click here to allow." Simply click on that popup and your JS should work. Once online, your users should not need to do this unless their browser is set up to block JS or anything like that.

Hope this helps.

peejeno
01-30-2007, 08:57 PM
thanks, i got it!

-p