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" Newsgroups: comp.lang.javascript Subject: Re: DOM styling modified by JavaScript does not affect first rendering Date: Fri, 31 Oct 2014 12:52:27 +0100 Organization: solani.org Lines: 26 Message-ID: References: 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: Cancel-Lock: sha1:NmKR3nKSyeKmg2zjSsgnC95X4tM= X-NNTP-Posting-Host: eJwNycEBwCAIA8CVRAiBcUBl/xHa+x7UxQ/N4YbB3CK51R7iqmD535IcJkQSvTRqHy1jd+DNB/pHEB4= Xref: csiph.com comp.lang.javascript:26059 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] -- Christoph M. Becker