
268 Capítulo 7
exercício solução
Agora você possui duas funções customizadas – cada uma com referências
às funções relâmpago que você escreveu no Capítulo 5 – que respondem aos
eventos onfocus e onblur do objeto window.
lightning_one()
clearInterval
clearInterval int2
clearInterval int3
setInterval
setIntervalint2
setInterval
int3
lightning_one();
lightning_two();
lightning_three()
goLightning();
window.onblur = stopLightning;
window.onfocus = goLightning;
var int1, int2, int3 ;
function goLightning(){
= ( function() {
},
4000
);
= ( function() {
},
5000
);
= ( function() {
},
7000
);
}
function stopLightning()
{
window. ...