diff options
author | Alex Xu <alex_y_xu@yahoo.ca> | 2014-02-14 08:05:27 -0500 |
---|---|---|
committer | Alex Xu <alex_y_xu@yahoo.ca> | 2014-02-14 08:05:27 -0500 |
commit | f5ccc58a9ad9b2e5c65806bc2c52217e8e3fff68 (patch) | |
tree | 5b12682f459735dfbdd8e0f5ba230f537f1526bc /www/js/api.js | |
parent | 1f069412967c751d288cdf63508bb65ad367e3b1 (diff) | |
download | html5ks-f5ccc58a9ad9b2e5c65806bc2c52217e8e3fff68.tar.xz html5ks-f5ccc58a9ad9b2e5c65806bc2c52217e8e3fff68.zip |
add spinner
Diffstat (limited to 'www/js/api.js')
-rw-r--r-- | www/js/api.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/www/js/api.js b/www/js/api.js index 225cf38..0dd7951 100644 --- a/www/js/api.js +++ b/www/js/api.js @@ -1,3 +1,4 @@ +"use strict"; window.html5ks.api = { init: function () { var chrs = html5ks.data.characters; @@ -48,10 +49,13 @@ window.html5ks.api = { return false; }; + html5ks.spin(1); + _nextType(); el.oncanplaythrough = function () { el.play(); + html5ks.spin(-1); }; el.onerror = function (e) { @@ -260,6 +264,7 @@ window.html5ks.api = { var lookup = document.getElementById(name), el = lookup || document.createElement("img"); if (!location && !lookup) location = "center"; + html5ks.spin(1); el.onload = function () { if (location) { // calculate position @@ -273,10 +278,12 @@ window.html5ks.api = { } el.style.display = "block"; } + html5ks.spin(-1); deferred.resolve(); }; el.onerror = function () { el.parentNode.removeChild(el); + html5ks.spin(-1); deferred.resolve(); }; var nom = name; |