Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #26059

Re: DOM styling modified by <body onload=> JavaScript does not affect first rendering

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From "Christoph M. Becker" <cmbecker69@arcor.de>
Newsgroups comp.lang.javascript
Subject Re: DOM styling modified by <body onload=> JavaScript does not affect first rendering
Date Fri, 31 Oct 2014 12:52:27 +0100
Organization solani.org
Lines 26
Message-ID <m2vt5h$nji$1@solani.org> (permalink)
References <op.xognrthttnmj2w@cbealls-imac.local>
Mime-Version 1.0
Content-Type text/plain; charset=iso-8859-15
Content-Transfer-Encoding 7bit
X-Trace solani.org 1414756337 24178 eJwFwQkBwDAIA0BLJQ2fHKDDv4Td6TWxcZoadXUREudEyVSBoX6YW3gQXqLntS86vwQRNfgBBPEQjg== (31 Oct 2014 11:52:17 GMT)
X-Complaints-To abuse@news.solani.org
NNTP-Posting-Date Fri, 31 Oct 2014 11:52:17 +0000 (UTC)
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0
X-User-ID eJwFwYEBwCAIA7CXHJR2ngMo/59gEs6PLTCImBhkqia72haLKlP/eztxsaS8zjo45p7rCPYAK60RJw==
In-Reply-To <op.xognrthttnmj2w@cbealls-imac.local>
Cancel-Lock sha1:NmKR3nKSyeKmg2zjSsgnC95X4tM=
X-NNTP-Posting-Host eJwNycEBwCAIA8CVRAiBcUBl/xHa+x7UxQ/N4YbB3CK51R7iqmD535IcJkQSvTRqHy1jd+DNB/pHEB4=
Xref csiph.com comp.lang.javascript:26059

Show key headers only | View raw


Chris Beall wrote:

> (If this is too far off-topic for this group, please suggest another)
> 
> Testcase: http://beallsprings.org/sandbox/Mod%20DOM%20test.html
> 
> Observation: Of the tested browsers, only Firefox renders the page AFTER
> applying the style modifications (which is what I wanted).
> 
> Question: Is there a way to make this work on all modern browsers?  How
> about an easy way?  Or is it a rather widespread bug?
> 
> Why would you want to do this:  Because I want to modify animation
> timing based on the current dimensions of the window, without user
> interaction and when the page is first displayed.  The intent is to
> synchronize an animated walking-figure .gif to the window width.

Have you tried to use the DOMContentLoaded event[1] of the document
instead of window's load event?  I don't know if that would make any
difference, but it seems to be worth a try.

[1] <https://developer.mozilla.org/en-US/docs/Web/Events/DOMContentLoaded>

-- 
Christoph M. Becker

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

DOM styling modified by <body onload=> JavaScript does not affect first rendering "Chris Beall" <Chris_Beall@prodigy.net> - 2014-10-28 18:08 -0400
  Re: DOM styling modified by <body onload=> JavaScript does not affect first rendering BootNic <bootnic.bounce@gmail.com> - 2014-10-29 00:26 -0400
  Re: DOM styling modified by <body onload=> JavaScript does not affect first rendering John Harris <niam@jghnorth.org.uk.invalid> - 2014-10-29 15:33 +0000
  Re: DOM styling modified by <body onload=> JavaScript does not affect first rendering Dr J R Stockton <reply1400@merlyn.demon.co.uk.invalid> - 2014-10-29 21:11 +0000
    Re: DOM styling modified by <body onload=> JavaScript does not affect first rendering "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-10-30 10:12 +0100
      Re: DOM styling modified by <body onload=> JavaScript does not affect first rendering Dr J R Stockton <reply1400@merlyn.demon.co.uk.invalid> - 2014-10-31 20:45 +0000
        Re: DOM styling modified by <body onload=> JavaScript does not affect first rendering "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-11-01 10:12 +0100
          Re: DOM styling modified by <body onload=> JavaScript does not affect first rendering Tim Streater <timstreater@greenbee.net> - 2014-11-01 10:19 +0000
            Re: DOM styling modified by <body onload=> JavaScript does not affect first rendering "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-11-01 12:22 +0100
            Re: DOM styling modified by <body onload=> JavaScript does not affect first rendering Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-11-01 15:22 +0100
          Re: DOM styling modified by <body onload=> JavaScript does not affect first rendering "Christoph M. Becker" <cmbecker69@arcor.de> - 2014-11-01 11:32 +0100
            Re: DOM styling modified by <body onload=> JavaScript does not affect first rendering "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-11-01 12:25 +0100
            Re: DOM styling modified by <body onload=> JavaScript does not affect first rendering Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-11-01 15:23 +0100
              Re: DOM styling modified by <body onload=> JavaScript does not affect first rendering "Christoph M. Becker" <cmbecker69@arcor.de> - 2014-11-01 16:50 +0100
                Re: DOM styling modified by <body onload=> JavaScript does not affect first rendering Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-11-01 20:40 +0100
                Re: DOM styling modified by <body onload=> JavaScript does not affect first rendering "Christoph M. Becker" <cmbecker69@arcor.de> - 2014-11-02 20:55 +0100
                Re: DOM styling modified by <body onload=> JavaScript does not affect first rendering Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-11-29 19:27 +0100
    Re: DOM styling modified by <body onload=> JavaScript does not affect first rendering "Chris Beall" <Chris_Beall@prodigy.net> - 2014-10-30 15:46 -0400
  Re: DOM styling modified by <body onload=> JavaScript does not affect first rendering "Christoph M. Becker" <cmbecker69@arcor.de> - 2014-10-31 12:52 +0100
    Re: DOM styling modified by <body onload=> JavaScript does not affect first rendering "Chris Beall" <Chris_Beall@prodigy.net> - 2014-10-31 10:37 -0400
  Re: DOM styling modified by <body onload=> JavaScript does not affect first rendering "Chris Beall" <Chris_Beall@prodigy.net> - 2014-10-31 12:53 -0400
    Re: DOM styling modified by <body onload=> JavaScript does not affect first rendering Joao Rodrigues <groups_jr-1@yahoo.com> - 2014-11-01 10:41 -0200
      Re: DOM styling modified by <body onload=> JavaScript does not affect first rendering Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-11-01 15:29 +0100
      Re: DOM styling modified by <body onload=> JavaScript does not affect first rendering "Chris Beall" <Chris_Beall@prodigy.net> - 2014-11-01 18:03 -0400

csiph-web