Results 1 to 2 of 2

Thread: Trouble with changing DOM properties in FF. Need quick help!

  1. #1
    Join Date
    Apr 2008
    Location
    San Diego, CA
    Posts
    352
    Thanks
    57
    Thanked 6 Times in 6 Posts

    Default Trouble with changing DOM properties in FF. Need quick help!

    I'm still pretty new to Javascript - surely there is some basic idea I'm missing here. I'm using the following code to change the width and height of a div, but Firefox doesn't want to play ball - only IE changes the width and height of the mainImageFrame div when this function is run:

    Code:
    function changeZoom(width,height) {
            window.resizeTo(width+270,height+150);
            document.getElementById("mainImageFrame").style.width=width;
            document.getElementById("mainImageFrame").style.height=height;
    }
    Here is an example link:

    <a href="javascript:void(0);" onclick="changeZoom(640,480)">640x480</a>

    Firefox changes the window size to the specified size, but not the div. IE changes both. This function is just the latest iteration of my attempt to get the div to resize, so if I should be approaching this another way by all means let me know. I R NEWBIE!

  2. #2
    Join Date
    Apr 2008
    Location
    San Diego, CA
    Posts
    352
    Thanks
    57
    Thanked 6 Times in 6 Posts

    Default

    I found the answer! Thanks to anyone who was looking at my issue.

    The correct code was:

    Code:
    function changeZoom(width,height) {
            window.resizeTo(width+270,height+150);
            document.getElementById("mainImageFrame").style.width=width+"px";
            document.getElementById("mainImageFrame").style.height=height+"px";
    }
    I hates you, IE. Making me think you were doing something right for once. >_>

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
  •