I created a function to generate display effect for a certain time, the images are loaded only in the load of the page, then Uncaught ReferenceError: lightning_one is not defined
as shown below:
The functions are these:
function lightning_one(t) {
$('#container #lightning1').fadeIn(250).fadeOut(250);
setTimeout('lightning_one()', t);
}
function lightning_two(t) {
$('#container #lightning2').fadeIn('fast').fadeOut('fast');
setTimeout('lightning_two()', t);
}
function lightning_three(t) {
$('#container #lightning3').fadeIn('fast').fadeOut('fast');
setTimeout('lightning_three()', t);
}
lightning_one(4000);
lightning_two(5000);
lightning_three(7000);
Remembering that the images load only after the page is displayed after the console error is displayed and the images are no longer displayed. The idea will be repeated according to the given time. Where am I going wrong?