I have done this preloader using jquery setTimeOut. It works as it is supposed to. But, when I change to another tab for 1 seconds and come back to this tab then it looks awful. Timeout doesn’t work properly. You can try it for yourself. Is there any other way to achieve same effect? I am not happy with the end result. I want it to pause the setTimeOut on tab change and resume on tab active.