Results 1 to 7 of 7

Thread: window.resize question

  1. #1
    Join Date
    Nov 2005
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default window.resize question

    hello everyone! i've been searching and reading around the forum but haven't been able to find something that could help what i'm currently trying to do.

    i like this script below to resize the browser but is there a way to disable the address bar/menu, toolbar? i've tried hide() doesn't seem to work

    <script>
    window.resizeTo(222, 505);
    </script>

    thank you so much in advance for comments and suggestions. have a great day!

    edit : sorry does anyone know the pros and cons of this? i've heard numerous debates about firefox not working with this script. oh, heh i should go install it

  2. #2
    Join Date
    Nov 2005
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    oops this should be in html >.<

  3. #3
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    This does work with Firefox, but there is an option which is set by default to disallow scripts from resizing an existing window. You cannot remove the toolbars from an existing window, but you can create a new window without them using the third parameter of window.open().
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  4. #4
    Join Date
    Jul 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Twey
    You cannot remove the toolbars from an existing window, but you can create a new window without them using the third parameter of window.open().
    What is the script to do this in a new window? I have never gotten this to work!

  5. #5
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Code:
    window.open('http://www.example.com/url/', '', 'toolbar=no,location=no,menubar=no,directories=no');
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  6. #6
    Join Date
    Jul 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thank you so much, I got this to work, but I'm doing something else wrong.

    This is for my portfolio page; I want my homepage to have the toolbars, but when the portfolio link is clicked, I want a new window to open without the toolbars. I've seen sites that do this, but don't see the code when I view the source.

    As of now, when I click the portfolio link from the main page, one window pops up with the toolbars, and then another one pops up without (but they both have the same content). How do I make the link open a page with no toolbars?

    Rikki

  7. #7
    Join Date
    Jul 2006
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Rikki, try this (code to go in your homepage):

    <html>
    <head>
    <title>homepage</title>

    <SCRIPT LANGUAGE="JavaScript">
    <!-- Begin
    function popUp(URL) {
    day = new Date();
    id = day.getTime();
    eval = window.open(URL, 'name', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=500,height=250');
    eval.moveTo(5,5);
    }

    // End -->
    </script>
    </head>
    <body>

    <a href="javascriptopUp('myportfolio.htm')">My portfolio</a>

    </body>
    </html>

    Change the "eval.moveTo(5,5);" to position the window wherever you want to on the page.

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
  •