From 4d38b42d2eed239ef18bbb9a4d352e5714687ec0 Mon Sep 17 00:00:00 2001 From: Bala Clark Date: Thu, 15 Sep 2011 11:23:24 +0200 Subject: [PATCH] show loading percentage --- lib/ComicBook.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/ComicBook.js b/lib/ComicBook.js index a58c3ef..6aa30f1 100755 --- a/lib/ComicBook.js +++ b/lib/ComicBook.js @@ -10,7 +10,7 @@ - check for html5 feature support where used: diveintohtml5.org/everything.html or www.modernizr.com - write bin scripts to minify & join all js - when applying enhancements reading position gets lost - - use a loading bar / percentage indicator instead of explictly showing which pages are loading + - loading bar - full browser test - IE9 / FF3.6+ / Chrome / Safari / Opera Nice 2 have: @@ -464,7 +464,8 @@ function ComicBook(id, srcs, opts) { page.onload = function () { pages[i] = this; loaded.push(i); - $("#cb-status").text("loaded page " + (i + 1) + " of " + no_pages); + + $("#cb-status").text("loading " + Math.floor((loaded.length / no_pages) * 100) + "%"); // TODO: put back in the page render code, page request code };