Hey guys i have the following part small snippet in my JS snippet :
[CODE]setTimeout( function() {
isRevealed = !isRevealed;
isAnimating = false;
console.log(‘set Timeout reveal ‘ + reveal);
if( reveal ) {
noscroll = false;
enable_scroll();
}
}, 2000 );
now the above setTimeout does’t seem to really be a critical part of the code snippet , as if i take off the setTimeout function and only keep the lines of code inside it , everything still functions properly .
so basically what is the setTimeout function doing ??
My calculated guess is its doing the following :
setTimeout( function() {
[COLOR=”#FF0000″]isRevealed = !isRevealed;
isAnimating = false;
console.log(‘set Timeout reveal ‘ + reveal);
if( reveal ) {
noscroll = false;
enable_scroll();
}
}, 2000 );
its executing all the lines of code in marked in red and after that the control is still inside setTimeOut for 2 seconds. what i mean by that is after the execution of the content marked in red , no other part of the script(this setTimeout function is just part of a small JS script) is going to execute for the next 2 secounds .
Thanks.
Gautam.