The link blinks 5 times on the page when the page loads.
$(document).ready(function() {
function1(1);
//some more functions
});
function function1(hide){
if((hide<10)){
if (hide%2==1){
$('.myclass2').css("color","black");
}
else{
$('.myclass2').css("color","white");
}
hide = hide+1;
}
else{
//some code to stop performing of this function.
}
setTimeout("blinks("+hide+")",300);
}.
As result, class myclass2 blinks 10/2=5 times by 300ms. Once variable hide reaches 10, the function1 is doing nothing (just checks if (hide<10) for unlimited number of times recursively).
P.S.
Does it make sense to stop performing function1?
If yes, then how?
Important: .ready() contains not just function1, but another functions as well. They should keep working.
Thank you.
and to end the function: