A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Javascript - resize function - right scripting?

  1. #1
    FK Photoshop Slut rugbystud's Avatar
    Join Date
    Jul 2000
    Location
    Too drunk to remember...
    Posts
    3,537
    Is there anything wrong with this javascript to resize the browser window? It doesnt work...

    <script language="JavaScript" type="text/JavaScript">
    <!--
    function resize()
    {
    for (i=300; i<=490; i+=20)
    {
    self.resizeTo(700,i);
    }
    self.resizeTo(700,490);
    }
    //-->
    </script>

  2. #2
    Registered User
    Join Date
    Feb 2001
    Posts
    13,039
    Hi,

    it looks you want a gradual change....
    So you need
    - the current value as a global var
    - a timer that calls a function to add one step

    h = 300;
    function higher()
    { h += 20;
    if(h <= 490)
    { self.resizeTo(700, h);
    setTimeout("higher()", 300);
    }
    }

    start the entire process by calling higher() once

    Musicman

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center