From: DL on 15 May 2010 22:57 Hi, I know that window.screen defines the monitor/display's width and height. However, when a new window is re-sized by a user how do we know its the new window's width and height? Maybe silly question... thanks.
From: VK on 16 May 2010 07:00 On May 16, 6:57 am, DL <tatata9...(a)gmail.com> wrote: > Hi, > > I know that window.screen defines the monitor/display's width and > height. However, when a new window is re-sized by a user how do we > know its the new window's width and height? Maybe silly question... > thanks. Well, window always know its actual size, just read it. You must be wanted to ask "How to know if window was resized so to get hew width and height?" window host object has onresize event handler, so use it: window.onresize = function() { /* update values */ } Note: there is a lost lasting peculiarity in NN and still in IE with resize event being called twice each time: first time on resize end, second time (optional) on window scrollbars display/removal if the new area gets too small or too big. Doesn't happen if scrollbars are not auto.
From: DL on 16 May 2010 19:17 On May 16, 7:00 am, VK <schools_r...(a)yahoo.com> wrote: > On May 16, 6:57 am, DL <tatata9...(a)gmail.com> wrote: > > > Hi, > > > I know that window.screen defines the monitor/display's width and > > height. However, when a new window is re-sized by a user how do we > > know its the new window's width and height? Maybe silly question... > > thanks. > > Well, window always know its actual size, just read it. You must be > wanted to ask "How to know if window was resized so to get hew width > and height?" > > window host object has onresize event handler, so use it: > > window.onresize = function() { > /* update values */ > > } > > Note: there is a lost lasting peculiarity in NN and still in IE with > resize event being called twice each time: first time on resize end, > second time (optional) on window scrollbars display/removal if the new > area gets too small or too big. Doesn't happen if scrollbars are not > auto. Sorry, I think my question statement was unclear. Here's another attempt. General Info: I have a user interface page/form that has an iframe with id and name of "datafrm" within it. Current State: using js to preset the iframe's width and height using style like document.getElementById('datafrm').style.width = screen.width; .... Goal: Make the width and height of the iframe dynamic, that is about 90% of the current browser's window height and width respectively. This current window may be re-sized by a user any time. And when that happens I'd like the the height and width of the iframe to reflect that. Browsers to be supported: IE 7/8 and Firefox 3.5.x for now. Thanks, VK.
From: nick on 16 May 2010 19:47 > General Info: > I have a user interface page/form that has an iframe with id and name > of "datafrm" within it. Okay. > Current State: > using js to preset the iframe's width and height using style like > document.getElementById('datafrm').style.width = screen.width; Why not use CSS? <style> #datafrm { width:100%; } </style> > Goal: > Make the width and height of the iframe dynamic, that is about 90% of > the current browser's window height and width respectively. Okay, so: <style> #datafrm { width:90%; } </style> > This current window may be re-sized by a user any time. And when that > happens I'd like the the height and width of the iframe to reflect > that. ....CSS?
From: DL on 16 May 2010 22:56 On May 16, 7:47 pm, nick <nick...(a)fastmail.fm> wrote: > > General Info: > > I have a user interface page/form that has an iframe with id and name > > of "datafrm" within it. > > Okay. > > > Current State: > > using js to preset the iframe's width and height using style like > > document.getElementById('datafrm').style.width = screen.width; > > Why not use CSS? > > <style> #datafrm { width:100%; } </style> > > > Goal: > > Make the width and height of the iframe dynamic, that is about 90% of > > the current browser's window height and width respectively. > > Okay, so: > > <style> #datafrm { width:90%; } </style> > > > This current window may be re-sized by a user any time. And when that > > happens I'd like the the height and width of the iframe to reflect > > that. > > ...CSS? Have you tried it? It simply does not work with IE7 nor Firefox 3.5.x. By that, I mean, the iframe now defaults to a tiny one... instead of 90% of the current window... test box OS = XP
|
Next
|
Last
Pages: 1 2 Prev: FAQ Topic - What is JScript? (2010-05-16) Next: Achat Kamagra en ligne ici |