By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,183 Members | 1,134 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,183 IT Pros & Developers. It's quick & easy.

how to "suspend" layout

P: n/a
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi all,
I was wondering whenever it existed a method to tell browsers to suspend
the layout of the page while a js function is executed.
This problem arises from the fact that I'm currently trying to code a
page with many transparent elements (be they transparent PNGs or simply
elements with css opacity < 1) and every time I move or otherwise change
one of their (visual) properties, the browser has to repaint almost
everything.
This may be fine until you modify just one element once in a while, but
if you're trying to _animate_ multiple elements, the processor
skyrockets immediately to 100% and the animation, well... it's not quite
an animation.
So I thought that, maybe, there existed a (eventually even non-standard)
way to tell the browser not to repaint the elements until I
moved/modified all those I wish to. Something like:

function AnimationCallback() {
SuspendLayout();

// perform all elements manipulation here

ResumeLayout();
}

or the like.
While this won't solve the fact that browsers are still terribly slow
when handling transparencies, maybe it could help a bit.
Any insight on this would be much appreciated.
Thank you,
Carlo Alberto Ferraris
strayorange.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHP/eIypa2JhbVv6QRAtMTAJ9XPTE7CL+z3PEnMbmilm3qlfasQACg v0cO
XWFUOxkkEFmcUCz6N27H2U8=
=nr0j
-----END PGP SIGNATURE-----
Nov 18 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
CAFxX wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Please put this in the header or disable it for NetNews.

Your From header is also broken, see

- RFC1036 subsection 2.1.1
- RFC2822 subsection 3.4.1
- RFC 1855 subsection 3.1.1, and
- probably the Terms of Use of your access provider.
I was wondering whenever it existed a method to tell browsers to suspend
the layout of the page while a js function is executed.
This problem arises from the fact that I'm currently trying to code a
page with many transparent elements (be they transparent PNGs or simply
elements with css opacity < 1) and every time I move or otherwise change
one of their (visual) properties, the browser has to repaint almost
everything.
This may be fine until you modify just one element once in a while, but
if you're trying to _animate_ multiple elements, the processor
skyrockets immediately to 100% and the animation, well... it's not quite
an animation.
Try to use timeout/interval values that are not below the system
ticker interval. Values of 100 (ms) and above should be safe.
PointedEars
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16
Nov 18 '07 #2

P: n/a
Thomas 'PointedEars' Lahn said the following on 11/18/2007 10:32 AM:
CAFxX wrote:
>-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Please put this in the header or disable it for NetNews.

Your From header is also broken, see

- RFC1036 subsection 2.1.1
- RFC2822 subsection 3.4.1
- RFC 1855 subsection 3.1.1, and
- probably the Terms of Use of your access provider.
Probably the opposite as munged From headers are often encouraged by
access providers. Can't spam an address you don't have.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Nov 18 '07 #3

P: n/a
Ed
On Nov 18, 2:27 am, CAFxX <usenet0...@REMOVEMEcafxx.cjb.netwrote:
So I thought that, maybe, there existed a (eventually even non-standard)
way to tell the browser not to repaint the elements until I
moved/modified all those I wish to. Something like:

function AnimationCallback() {
SuspendLayout();

// perform all elements manipulation here

ResumeLayout();

}
This article might be helpful:

http://dev.opera.com/articles/view/e...script/?page=3

This is also discussed here (see "Edit Subtrees Offline"):

http://www.peachpit.com/articles/art...&seqNum=5&rl=1
Nov 18 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.