Results 1 to 4 of 4

Thread: Animated Window 2 Resize window

  1. #1
    Join Date
    Feb 2006
    Posts
    68
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Animated Window 2 Resize window

    http://www.dynamicdrive.com/dynamici...imatedwin2.htm

    I was fooling around with this and the script is great, question though, is there any way to make the new window open to a certain size.

    I thought it would be under the liine

    windowprops='width=100,height=100,scrollbars=no,status=no,resizable=yes'

    Under the width and height but I've changed that and so far I get no difference. Am I doing something wrong or is it someplace else.

    I just want a much smaller window to open

    Thanks

  2. #2
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    Here's a modified code for you. Tested in FF 2.0.0.2 on XP Home and Pro.

    Code:
    <SCRIPT language=JavaScript>
    <!-- Begin
    
    //Animated Window- By Rizwan Chand (rizwanchand@hotmail.com)
    //Modified by DD for NS compatibility
    //Visit http://www.dynamicdrive.com for this script
    //Again Modified by DD member thetestingsite
    
    function expandingWindow(website) {
    var width = 400; //assign your desired width
    var height = 650; //assign your desired height
    var windowprops='scrollbars=yes,status=yes,resizable=yes'
    var heightspeed = 2; // vertical scrolling speed (higher = slower)
    var widthspeed = 7; // horizontal scrolling speed (higher = slower)
    var leftdist = 10; // distance to left edge of window
    var topdist = 10; // distance to top edge of window
    
    if (window.resizeTo&&navigator.userAgent.indexOf("Opera")==-1) {
    /*var winwidth = window.screen.availWidth - leftdist;
    var winheight = window.screen.availHeight - topdist;*/
    
    var sizer = window.open("","","width=100,height=100,left=" + leftdist + ",top=" + topdist +","+ windowprops);
    for (sizeheight = 1; sizeheight < height; sizeheight += heightspeed)
    sizer.resizeTo("1", sizeheight);
    for (sizewidth = 1; sizewidth < width; sizewidth += widthspeed)
    sizer.resizeTo(sizewidth, sizeheight);
    sizer.location = website;
    }
    else
    window.open(website,'mywindow');
    }
    // End -->
    </SCRIPT>
    Just place that in the head of your document and call the script like normal.

    Hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  3. #3
    Join Date
    Feb 2006
    Posts
    68
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Works perfect, this should be added to the original archives as it makes the script complete

    Thanks for your help. I appreciate it.

  4. #4
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    Not a problem, and let us know if you need any more help.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

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
  •