4 ms·
The effect would be a lot nicer if it stopped when the tab lost focus. I would prefer not doing it at all, but my tastes are not everyone's.
by JasonFruit 14y ago
The effect would be a lot nicer if it stopped when the tab lost focus. I would prefer not doing it at all, but my tastes are not everyone's.
- ianstormtaylor 14y agoJust fixed it to use the page visibility API to do just that. Thanks for the idea!
- benjoffe 14y agoLooks like it only alternates between the two states (flashing and not flashing), so if the page is opened as a new tab (i.e. not focused to begin with) then the flashing occurs when the tab is not focused.
- ianstormtaylor 14y agoYup good call, the first call to the interval shouldn't assume focus