SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Guru
    Join Date
    Sep 2007
    Posts
    971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Onload change website size

    Hi, is there a code out there that can do this.

    I type my domain name into the browser and the page automatically resizes itself to a specified height and width in pixels.
    Animated Chatrooms - www.121chatrooms.net

  2. #2
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,807
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    yup
    Code:
    self.moveTo(0,0); 
    self.resizeTo(screen.availWidth,screen.availHeight);
    change: screen.availWidth,screen.availHeight to the height and width
    change: 0,0 to where you want it on the page

    Think about it carefully though as it really annoys visitors when their browser gets changed without warning - especially if you have many tabs open.
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  3. #3
    SitePoint Guru
    Join Date
    Sep 2007
    Posts
    971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have added the code and modified the dimensions but when i view the site the page just shakes a little and dosnt resize, you can view it at http://www.121chatrooms.net
    Animated Chatrooms - www.121chatrooms.net

  4. #4
    SitePoint Guru
    Join Date
    Sep 2007
    Posts
    971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i have tried viewing the page in the latest internet explorer and firefox
    Animated Chatrooms - www.121chatrooms.net

  5. #5
    SitePoint Guru
    Join Date
    Sep 2007
    Posts
    971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok i am using the code <body onload="moveTo(306,150); resizeTo(1024,600);"> and it works. One more question can i disable the page from being resized for all browsers
    Animated Chatrooms - www.121chatrooms.net

  6. #6
    SitePoint Guru
    Join Date
    Sep 2007
    Posts
    971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    can anybody please help me?
    Animated Chatrooms - www.121chatrooms.net

  7. #7
    SitePoint Member
    Join Date
    Feb 2010
    Location
    3 Locust Street, Suite A Assonet, MA 02702
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think you should try using a javascript link in one page <a href="javascript:testJscript();"> link</a>

    to call this function in the header..


    function testJscript () {
    window.open("Test_Javascript_Window.html", "jstest", "height=600,width=800,channelmode=0,dependent=0,dir ectories=0,fullscreen=0,location=0,menubar=0,resiz able=0,scrollbars=0,status=0,toolbar=0");
    }
    Hope it will help you.

  8. #8
    SitePoint Guru
    Join Date
    Sep 2007
    Posts
    971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thats good, but can we modify something so when the page loads it automatically loads the testJscript link inside the same page and resizes it?
    Animated Chatrooms - www.121chatrooms.net

  9. #9
    SitePoint Guru
    Join Date
    Sep 2007
    Posts
    971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    this is my code now:

    Code:
    <script type="text/javascript">
    function testJscript () {
    window.open("a.htm", "jstest", "height=600,width=800,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resiz able=0,scrollbars=0,status=0,toolbar=0");
    }
    </script>
    <body onload="javascript:testJscript();"></body>
    Animated Chatrooms - www.121chatrooms.net


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
  •