Changes between Initial Version and Version 1 of Ticket #26086, comment 3
- Timestamp:
- 11/18/2013 04:50:37 PM (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #26086, comment 3
initial v1 5 5 {{{ 6 6 // `i` is just for testing, paste in the browser console and try it 7 var timeout, timerSet,i = 0;7 var timeout, i = 0; 8 8 9 9 function fireOnce() { 10 if ( timerSet ) { 11 clearTimeout( timeout ); 12 } 13 timeout = setTimeout( function() { i++; timerSet = false; console.log('run = '+i); }, 200 ); 14 timerSet = true; 10 clearTimeout( timeout ); 11 timeout = setTimeout( function() { i++; console.log('run = '+i); }, 200 ); 15 12 } 16 13