I have a jQuery UI progressbar that acts as a timer. However when I open the page, all it has is "Loading…" (added in html) and nothing else.
Links to files
HTML file: http://pastebin.com/Re0ZKVNY
Javascript file: http://pastebin.com/zynA5MnY
I can’t seem to find anything wrong with the code. Tried copy & pasting code from the jQuery UI demos, but nothing seems to make it work (with my code.).
It seems that you’re doing a few things wrong:
DIVelementThis is some simplified example that doesn’t use jQuery UI Progress bar but rather a custom solution the way that you actually use.
But basically let me also modify you code and move everything where it belongs:
Alternative
Since it seems that all you’re doing in your interval is animate progress bar it seems reasonable to just let jQuery do the animation instead. And since you’re incrementing your progress bar every 75ms and it takes 100 steps until you load content, you should run your animation for 7500ms then. It also makes progress bar run smoother.