Google Groups Home
Help | Sign in
Message from discussion Force update of on screen render after DOM element change
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
joebloe  
View profile
 More options May 16, 1:00 pm
Newsgroups: comp.lang.javascript
From: joebloe <remid0d...@gmail.com>
Date: Fri, 16 May 2008 10:00:18 -0700 (PDT)
Local: Fri, May 16 2008 1:00 pm
Subject: Force update of on screen render after DOM element change
I know this question comes up from time to time, but 10-15 minutes of
googling hasn't produced a useful answer for me. I'm looking for the
equivalent of insert_magic_here() in:

some_element.style.color = 'red';
insert_magic_here();
some_element.style.color = 'blue';
insert_magic_here();

where insert_magic_here() will cause the updated DOM to be rendered
immediately. I need to do some animation in the middle of an event
handler (keypress). Is the basic problem that Firefox doesn't do the
on screen render until the event handler returns? Or ...? Anyway there
is quite a bit of work to do after this completes, including,
potentially, many other similar sequences of events.

If it helps, this code is intended to run only in JavaScript >= 1.7,
with Firefox as a reference platform.

I can come up with various painful ways to do this with closures and
so on but I am looking for something that won't serve as an entry in
an obfuscated Javascript contest. Also I haven't looked at generators
as a solution yet.

Your Help Is Appreciated(TM).


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google