From d3aa635aace03bb8e912b1aa122ebd796f2370b3 Mon Sep 17 00:00:00 2001 From: rolux Date: Mon, 6 Sep 2010 02:56:18 +0200 Subject: [PATCH] change onload fade --- build/js/ox.load.js | 21 ++++++++++++++++----- build/js/ox.ui.js | 12 ++++++++++-- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/build/js/ox.load.js b/build/js/ox.load.js index aa26fa3..33c7934 100644 --- a/build/js/ox.load.js +++ b/build/js/ox.load.js @@ -1,7 +1,18 @@ $(function() { var $body = $('body'), - $head = $('head'), + $div = $('
') + .css({ + position: 'absolute', + left: 0, + top: 0, + right: 0, + bottom: 0, + background: 'rgb(240, 240, 240)', + opacity: 1, + zIndex: 1000 + }) + .appendTo($body), css = { position: 'absolute', left: 0, @@ -50,7 +61,7 @@ $(function() { width: '32px', height: '32px' })) - .appendTo($body), + .appendTo($div), deg = 0, interval = setInterval(function() { deg = (deg + 30) % 360; @@ -85,7 +96,7 @@ $(function() { } }); function loaded() { - var $div = $('
') + var $div_ = $('
') .css($.extend(css, { width: (length * 72) + 'px', height: '72px' @@ -127,9 +138,9 @@ $(function() { }, 250); }) ) - .appendTo($div); + .appendTo($div_); }); - $div.appendTo($body); + $div_.appendTo($div); //throw new Error('User Agent not supported.'); } } diff --git a/build/js/ox.ui.js b/build/js/ox.ui.js index f601148..1953f70 100644 --- a/build/js/ox.ui.js +++ b/build/js/ox.ui.js @@ -216,10 +216,15 @@ requires $.getJSON(self.options.config, function(data) { var config = data; that.request(self.options.init, getUserData(), function(data) { - Ox.print('!!!', data) var user = data.data.user; $(function() { - $('body').empty(); + var $div = $body.find('div'); + $body.find('img').remove(); + $div.animate({ + opacity: 0 + }, 1000, function() { + $div.remove(); + }); callback({ config: config, user: user @@ -636,6 +641,9 @@ requires Ox.Request = function() { + // fixme: do we want, instead of request('find', data, callback), + // something like server.find(data, callback)? + var cache = {}, pending = {}, requests = {},