[whatwg] window.setInterval if visible.

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