Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Sep 2002
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    how can i fix window.resizeTo problem in firefox?

    I need to use the following code in an iframe in order to resize it when it opens.

    <SCRIPT LANGUAGE="javascript">
    <!--
    width=700;
    height=180;
    window.resizeTo(width,height);
    //-->
    </SCRIPT>

    The problem is that it works in IE but does not work in firefox.
    Can anyone think of a way of making it work in firefox?

    Thanks.

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,048
    Thanks
    0
    Thanked 251 Times in 247 Posts
    Is there any reason why you're not putting the width and height in the <iframe> tag itself?

  • #3
    Senior Coder joh6nn's Avatar
    Join Date
    Jun 2002
    Location
    72° W. 48' 57" , 41° N. 32' 04"
    Posts
    1,887
    Thanks
    0
    Thanked 1 Time in 1 Post
    Firefox allows its users to disable the resizing of windows. check to make sure that the user preferences are appropriately set.
    bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

    i am a loser geek, crazy with an evil streak,
    yes i do believe there is a violent thing inside of me.

  • #4
    New to the CF scene
    Join Date
    Sep 2002
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    glenngv: i have to do it like that because the content changes dynamically all the time.

    joh6nn: yes, i am sure it is enabled. it just does not work when its in an iframe.

  • #5
    Senior Coder joh6nn's Avatar
    Join Date
    Jun 2002
    Location
    72° W. 48' 57" , 41° N. 32' 04"
    Posts
    1,887
    Thanks
    0
    Thanked 1 Time in 1 Post
    wait...

    so, let's say you've got a window with a.html loaded into it, and a.html has an iframe containing b.html. are you saying that b.html's resizeTo javascript doesn't change the size of the iframe, or it doesn't change the window that contains a.html?

    if you're not asking about one of those two things, i don't know what you're asking.
    bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

    i am a loser geek, crazy with an evil streak,
    yes i do believe there is a violent thing inside of me.

  • #6
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,048
    Thanks
    0
    Thanked 251 Times in 247 Posts
    Quote Originally Posted by joh6nn
    are you saying that b.html's resizeTo javascript doesn't change the size of the iframe, or it doesn't change the window that contains a.html?
    I think it's the former. I've tried it in firefox and the iframe's size doesn't change the way IE does.

    The solution I can think of is to have this function in the page that contains the iframe.
    Code:
    function resizeIframe(w, h){
      document.getElementById("iframeID").contentWindow.resizeTo(w, h);
    }
    Then in each of the pages that will go to the iframe, call the function like this:
    Code:
    if (parent.resizeIframe){
      parent.resizeIframe(700, 180);
    }


  •  

    Posting Permissions

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