Please check example http://jsfiddle.net/FuFHe/7/
When I click on button Show Data loader div should be displayed and after couple of seconds hidden. In console log you can clearly see that display property of qloader div get set to block and none, but nothing happens, qloader div never gets displayed.
What is wrong?
That’s not a good way of sleeping. It eats up the CPU, and you can’t even rely on it taking the full 3 seconds on a fast machine. Instead use setTimeout():
That will allow the browser and your website to continue operating while you are waiting for the time to pass.