Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: resize window

  1. #1
    Join Date
    Oct 2006
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question resize window

    can someone help with script to resize window...

    if i load a certain page, the same window resizes to a size of 600 pixels width x 300 pixels height

    i dont want to open a new window...

    also, if the user maximises the window... it shouldnt resize again
    Last edited by flyingfish; 10-13-2006 at 09:41 PM.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Control freak! Kidding aside, you cannot reliably do this so, find a better way to deal with the issue, like designing your page so that the size of the view-port is less important.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Oct 2006
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    stilll... the site is about an experimental project and any experiment is worth doing!!!

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

    Default

    Code:
    Code:
    <script language="JavaScript" type="text/javascript">
    self.resizeTo('600', '300')
    </script>
    also, if the user maximises the window... it shouldnt resize again
    What do you mean? For the browser session? Pernamently?
    Last edited by tech_support; 10-17-2006 at 06:39 AM.
    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

  5. #5
    Join Date
    Oct 2006
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hope this helps...
    Give ur details as needed. U can menetion ur size to open the page..

    <script language="javascript">

    function name()
    {
    var Url=(the page to open)
    OpenWin = this.open(Url, "name of the window", "toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes,dependent=no,directories=no,width=900,height=400,x=0,y=0");
    }
    </script>

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

    Default

    He specifically said:
    i dont want to open a new window...
    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

  7. #7
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by flyingfish
    stilll... the site is about an experimental project and any experiment is worth doing!!!
    I think Hitler's Nazi doctors disproved that theory. As for another example, see:

    http://en.wikipedia.org/wiki/Tuskegee_experiment

    Anyways, this cannot be done reliably across browsers. In fact, your restrictions on not wanting to open a window and wanting to prevent the user from resizing their own window after you have resized it, make it impossible in any browser unless the user has no idea what they are doing. In which case, it is simply cruel.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  8. #8
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Ouch.
    John, I don't think any lives are in danger here... just browsers.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  9. #9
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I admit they're extreme examples - what came to mind. Just because a thing can be done doesn't mean that it should be done and, in this case, it can't be done anyway.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  10. #10
    Join Date
    Oct 2006
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default clarification

    thanx, the code sort of serves the purpose...

    when i said that
    also, if the user maximises the window... it shouldnt resize again
    i meant that after maximising, it should remain in a maximised state and should not resize once again to the size i have specified... so it will remain maximised and not resize to 600 x 300

    this is only for the particular session... so i guess the code is alrite.

    also is it seriously bad to resize the window? for an experimental art project??? i m not going to crash the system with it? am i???

    well someone came up with the idea of popping up a new window and then everyone got popup blockers on their browsers and there are so many users who cant figure out why nothings happening on the website...

    i am giving the flexibility, if the user wants to maximise or resize, he can

    are we discussing ethics in a scripting forum...

    thanx

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
  •