Forum Moderators: open

Message Too Old, No Replies

onFocus script

         

gonzo20

9:20 pm on Feb 20, 2002 (gmt 0)



I have a flash page I am opening in a new window with no chrome. Then I have the window in the back shrink so it's behind the new flash window. Then I center them. This is working fine, but now I want to have the window get bigger when it gets focus.

Right now i have a onFocus="enlarge();" in the body tag, then a function called enlarge that sets the window.resizeTo( hi, low), and a window.moveBy(-150,0)
This is working in Netscape pretty well, but when I use IE, it freezes up, and I have to force quit, by the way this is on a mac.

Any help would be great.

Oh, and does anyone know if you can grab the size and position of the current browser window your using, i couldn't find anything that would do it, just wondering.

thx

Gonzo20

tedster

9:55 am on Feb 21, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



gonzo20, welcome to the WebmasterWorld forums.

Unfortunately I can offer little help for your main question about IE Macintosh freeze ups when you resize and move a window. I once struggled with something similar and had little success. So I ended up closing the window and reopening it at the size and position I wanted...definitely kludgy but I had already poured too much time into it.

To get the size of a window you need two pairs of properties:
For Netscape use innerHeight and innerWidth.
For Explorer use clientHeight and clientWidth.

You can get the coordinates of the upper left corner of the window with another pair of properties.
For Netscape use screenX and screenY.
For Explorer use screenTop and screenLeft.

Caution:
I've heard that IE5 on Mac does not support this last pair. All in all, trying to closely control windows is very frustrating. That's why I end up closing and opening instead of resizing and moving.

gonzo20

8:12 am on Feb 22, 2002 (gmt 0)



Thanks i'll try that clientHeight and Width.

Nice forums you have here, thanks a bunch!

-gonzo20