LegendaryLaggy
LegendaryLaggy

Reputation: 455

Javascript , loading progress bar before site loads

I want to make a progress bar for a GUI site that I am making and I need a bit of code in javascript to detect if the site is loading and how many elements/images have loaded and has the site fully loaded. I have the progress bar made with css and I dont know how I can turn on/of elements in js.

How can I accomplish this in js or by using Jquery ?

Upvotes: 0

Views: 755

Answers (1)

JR.
JR.

Reputation: 1431

Some solutions to achieve what you want are:

  • Code a really little page with nothing but your favourite js framework (jQuery maybe?) and a little code that requests the rest of the elements of the page dinamically with AJAX counting which ones are finished or not with the load events.
  • For images you can also link "load" event and do a progress bar counting the total images grated/images loaded.
  • Other combiantions of the other two.

Upvotes: 2

Related Questions