Results 1 to 5 of 5

Thread: resize and center window? in IE7

  1. #1
    Join Date
    Nov 2006
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post resize and center window? in IE7

    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

  2. #2
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    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.
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

  3. #3
    Join Date
    Nov 2006
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post how do i do that?

    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

  4. #4
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    Quote Originally Posted by peejeno View Post
    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.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  5. #5
    Join Date
    Nov 2006
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    thanks, i got it!

    -p

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •