2

I mean page preloaders where you see percentage of loaded page. Is it just fakened or is it truly a size of just loaded page related to whole page size? Is it possible to measure it with javascript? How developers make it? Here's example which seems to be kinda http://www.ultranoir.com/en/#!/home/

lukaleli
  • 3,427
  • 3
  • 22
  • 32
  • `(filesloaded / totalfilestoload) * 100` – Kinected Oct 07 '12 at 20:25
  • that's simple math, but not the answer for what I'm asking for ;) I'm asking for possibilities to measure that- in your case filesloaded and totalfilesloaded – lukaleli Oct 07 '12 at 20:29
  • http://www.java2s.com/Tutorial/JavaScript/0600__MS-JScript/FilesCount.htm for finding total files, http://stackoverflow.com/questions/1293367/how-to-detect-if-javascript-files-are-loaded for how many loaded – Kinected Oct 07 '12 at 20:31

2 Answers2

3

Have a look at the jPreLoader jQuery plugin

Using it is very simple :

$(document).ready(function() {
  $('body').jpreLoader();
});
MyBoon
  • 1,290
  • 1
  • 10
  • 18
1

Most websites are faking it. I was also searching sometime ago and only found solution like this plugin: see in action here http://www.inwebson.com/demo/jpreloader/

<script type="text/javascript" src="js/jpreLoader.js"></script>
<script type="text/javascript">// <![CDATA[
  $(document).ready(function() {
  $('body').jpreLoader();
    });
// ]]></script>

also check out this solution, it's probably the closest to the real thing: http://www.seabreezecomputers.com/tips/progress.htm

Crazy_Bash
  • 1,755
  • 10
  • 26
  • 38