SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Mar 2002
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    <body onLoad=" resizeTo(382,430);">

    Hi all,

    I am using <body onLoad=" resizeTo(382,430);"> to automatically resize my window when the page is loaded. However, I need the window to remove the toolbars, scrollbars, and the like. Can anyone tell me how to do this? javascript or html would be fine.

    Dustin,
    aelaron@yahoo.

  2. #2
    Grumpy Mole Man Skunk's Avatar
    Join Date
    Jan 2001
    Location
    Lawrence, Kansas
    Posts
    2,067
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Eww, sounds like the kind of site that would have me heading for the "close" button as fast as I can

    I'm pretty sure you can't remove the toolbars etc from a window that has already been loaded - you have to create a new window with those elements turned off. I know you can't open a new window and close the current one (not without the browser popping up a "The site you are visiting is trying to close this window, should I let them?" dialog) so I think you've hit a dead end.

  3. #3
    What? Maelstrom's Avatar
    Join Date
    Oct 2001
    Location
    Whistler BC originally from Guelph Ontario
    Posts
    2,175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The only way to acheive this look with javascript is to popup immediately a new window, give focus to it, (opening it without toolbars etc...) and making it load the info you want. Oh yeah and closing the first window.

    The problem is the user will be prompted (in IE) to close the window and generally this is considered quite rude to take control of the windows like that
    Maelstrom Personal - Apparition Visions
    Development - PhP || Mysql || Zend || Devshed
    Unix - FreeBSD || FreeBsdForums || Man Pages
    They made me a sitepoint Mentor - Feel free to PM me or Email me and I will see if I can help.

  4. #4
    SitePoint Wizard Bill Posters's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    One option for utilising the original window would be as a Thank You/Relaunch/Close page.

    You could resize it to something smaller than the main popup window and position it on the screen.

    If the popup window (containing the main site) is positioned right too then the original (smaller window) will be tucked out of sight until the visitor closes the main window.
    (You could position them both anywhere you wanted. The center of the screen would be the obvious choice.)

    I would recommend this over trying to automatically close it.
    I would say that it is psychologically less intrusive to have a small window tucked away out of sight than to have a 'close window?' alert pop up before you've even entered the site properly.


    However, I have seen a javascript for switching off scrollbars on a non-javascript page, but I cannot recall where I have seen it or how well-supported it is (probably not very well), but I know such a script does exist.

    If such scripts exist for scrollbars, then it is possible that the other aspects of the window could be manipulated with javascript as well.
    Again, I can't say for sure, but it might serve as a last resort if you are desperate to have it that way.

    Fwiw, I use the method of having a popup window for the main body of the size and resizing, centering and forwarding the first window to a simple Thank You/Relaunch/Close page.

    It all works cleanly and well.

    Mind you, it is a design portfolio site which means I can get away with a bit more than the average site.
    Last edited by Bill Posters; Apr 1, 2002 at 05:59.
    New Plastic Arts: Visual Communication | DesignateOnline

    Mate went to NY and all he got me was this lousy signature


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
  •