Internet Bandaid   [RSS Feed]

setTimeout(‘somecall()’,0) to force a redraw of the screen

without comments

On several occasions, I’ve had websites that were animation heavy. And sometimes on the first page load, I would have a javascript function like renderSomething(); that will draw and position elements nicely. But sometimes, when the page first loads up, things still aren’t drawn precisely . Sometimes I can fix this by doing a setTimeout(‘renderSomething();’,0) right in the document.ready event handler, to force a redraw of the screen.

Written by John Lai

January 18th, 2014 at 6:48 pm

Posted in Uncategorized

Start Mission - Project management and invoicing

Leave a Reply