Wednesday, June 29, 2011

Put delay in JavaScript

Try use this function
---------------------

function pauseJS(ms) {
var date = new Date();
var curDate = null;
do {
curDate = new Date();
}while(curDate-date < ms);
}

this function stops the browser so nothing will work during that time
while setTimeout() didnt.

No comments:

Post a Comment