Re: DOM event flow



Michael Winter <m.winter@xxxxxxxxxxxxxxxx> wrote:

In trying to take it one step further I'd like the function to
execute only when the window width changes.

The code only needs slight modification:

this.onload = function() {
var width = document.body.clientWidth;

document.body.onresize = function() {
if (document.body.clientWidth != width)
location.reload();
};
};

This works when the viewport width is changed up or down by dragging the
right viewport border, but not when a non maximised MDI window is
maximised using the window button, it does work when an MDI window is
"unmaximized". It works when I close Opera's side panel, but not when I
open the panel.

Opera has a preliminary implementation of CSS3 media queries, this
allows dissolving a multi column layout for narrower window widths.
Currently the CSS media query isn't reevaluated on a window resize,
it requires a reload [...]

Has that been reported to Opera? I don't know if the query /must/ be
re-evaluated, but it certainly should be.

I'm not aware of a spec requirement to reevaluate the CSS media query
upon a window resize, nor am I convinced that it should be.

After a glance in a JS book

Based upon informed third-party opinion, most books on scripting are
rubbish, unfortunately. I've never read any myself, but the other
regulars in c.l.javascript can just about recommend "JavaScript: The
Definitive Guide, 4th Edition"[1] (and some may only consider that the
least bad, rather than good).

Being aware of that recommendation it was the first book I looked at,
but it didn't work for me at all. Like most JS books it assumes previous
programming experience, but more importantly, imo it is didactically
poor. "Professional JavaScript for Web Developers" by Nicholas C. Zakas
(Wrox) worked better for me despite the fact that it too assumes
programming experience.

But the main obstacle for me to learn JavaScript is my dislike for what
is typically done with it (I have it disabled by default in my browser),
the rare good uses I see for it, which results in only an occasional
desire to use it.

--
Spartanicus
.



Relevant Pages

  • Re: javascript:OpenChildWindow
    ... or on the MSN username) nothing happens. ... I right click on the image and select to open in a new window ... browsers and they break useful browser GUI ... when you click on a javascript pseudo-protocol link ...
    (comp.lang.javascript)
  • Re: Javascript disabled in my browser?
    ... I have already enabled Active Scripting ... > Click "OK" to close the Security window. ... > JavaScript is now enabled for our web site. ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: How to submit a form in a popup window?
    ... How do I submit that form1 from the javascript from my current window? ... submit that to its net server where some script will take the other inputs supplied by the form1 and return data to the popup window. ...
    (comp.lang.javascript)
  • comp.lang.javascript FAQ - Quick Answers 2008-10-13
    ... Javascript Tips ... _How can I disable the back button in a web browser_? ... _How do I check to see if a child window is open, ... upon the cache headers that your server sends. ...
    (comp.lang.javascript)
  • Re: How to submit a form in a popup window?
    ... How do I submit that form1 from the javascript from my current window? ... something via Javascript to mainwin, ...
    (comp.lang.javascript)