W3C home > Mailing lists > Public > whatwg@whatwg.org > October 2009

[whatwg] window.setInterval if visible.

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Thu, 15 Oct 2009 15:46:04 -0400
Message-ID: <4AD77BFC.8070808@mit.edu>
On 10/15/09 3:35 PM, Gregg Tavares wrote:
> I was wondering if there as been a proposal for either an optional
> argument to setInterval that makes it only callback if the window is
> visible OR maybe a window.setRenderInterval.

You might be interested in 
http://groups.google.com/group/mozilla.dev.platform/browse_thread/thread/527d0cedb9b0df7f/57625c94cdf493bf 
for some more discussion about approaches to this problem.  In 
particular, that proposal tries to address overeager animations in 
visible windows as well.

Note, by the way, that testing whether a window is "visible" is not 
cheap; testing whether an element is "visible" is even less cheap....

-Boris
Received on Thursday, 15 October 2009 12:46:04 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:18 UTC