A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: resolution adjust without popup

  1. #1
    Member
    Join Date
    Apr 2002
    Posts
    52

    resolution adjust without popup

    Hello

    i got the javascript in order for a site to readjust its size according to the viewers screen resoution using popups.

    But can someone tell me how to do this without it being a popup and maybe even automatically so without needing a button.

    cheers

  2. #2
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    call that same javascript function onLoad in your <body> tag instead of onClick on a button.

    gparis

  3. #3
    Member
    Join Date
    Apr 2002
    Posts
    52
    sorry for not explaining this propperly. oops I actually just realised this isn't really a flash question.
    maybe u can help me anyway:

    my index.html page has a button : javascriptpenpopup()
    which opens the main.html which holds the swf according to the screen resolution using javascript (see bottom):

    Is it posible to do this without the next page being a popup?
    Also without having to go thru a button to do this?
    So what i mean is that the index automatically opens the main.html with swf according to size on a new nonpopup page.


    cheers

    <script>


    var w = 750;
    var h = 450;
    if (screen.width >= 1024) {
    w = 1000;
    h = 600;
    }
    var x = Math.floor((screen.width-w)/2);
    var y = Math.floor((screen.height-h)/2);
    var windowFeatures = "left=" + x + ",top=" + y + ",width=" + w +
    ",height=" + h + ",scrollbars=no,resizable=no";


    function openpopup(){
    var popurl="main.html"
    var myWin = window.open(popurl, "", windowFeatures);
    }
    </script>

  4. #4
    Member
    Join Date
    Apr 2002
    Posts
    52
    sorry for not explaining this propperly. oops I actually just realised this isn't really a flash question.
    maybe u can help me anyway:

    my index.html page has a button : javascript: openpopup()
    which opens the main.html which holds the swf according to the screen resolution using javascript (see bottom):

    Is it posible to do this without the next page being a popup?
    Also without having to go thru a button to do this?
    So what i mean is that the index automatically opens the main.html with swf according to size on a new nonpopup page.


    cheers



    var w = 750;
    var h = 450;
    if (screen.width >= 1024) {
    w = 1000;
    h = 600;
    }
    var x = Math.floor((screen.width-w)/2);
    var y = Math.floor((screen.height-h)/2);
    var windowFeatures = "left=" + x + ",top=" + y + ",width=" + w +
    ",height=" + h + ",scrollbars=no,resizable=no";


    function openpopup(){
    var popurl="main.html"
    var myWin = window.open(popurl, "", windowFeatures);
    }

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