|
Posted by Spartanicus on 11/05/77 11:48
Michael Winter <m.winter@blueyonder.co.uk> 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
Navigation:
[Reply to this message]
|