From 0b2adb5b1d816cfccc17f95227c4f41f183ed5de Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Wed, 4 Mar 2015 00:42:14 +0100 Subject: [PATCH] Better animation --- css/crep.css | 3 ++- js/crep.js | 26 +++++++++++++++++++------- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/css/crep.css b/css/crep.css index 38fa72c..c95e99f 100755 --- a/css/crep.css +++ b/css/crep.css @@ -1,6 +1,7 @@ body { - background: #c6c6c6 url('../img/mainBgPattern.png') + background: #c6c6c6 url('../img/mainBgPattern.png'); + overflow-y: scroll; } .navbar-lower diff --git a/js/crep.js b/js/crep.js index 962ec02..a67e7e2 100755 --- a/js/crep.js +++ b/js/crep.js @@ -44,23 +44,35 @@ function loadDoc(location, callback) { var eventsLeft = 2 var html = '' + var mainContainer = $("#mainContainer") + var oldHeight = mainContainer.height() + function events() { eventsLeft += -1 if (eventsLeft <= 0) { + // In + // Calculations mainContainer.html(html) - dynamiseLinks(mainContainer) - pageSpecific(location) + mainContainer.height('auto') + newHeight = mainContainer.height() + mainContainer.height(oldHeight) + // Transition mainContainer.animate({ - height: "toggle", + height: newHeight, opacity: 1 + }, 'fast', function () { + mainContainer.height('auto') + dynamiseLinks(mainContainer) + pageSpecific(location) + callback() }) - callback() } } - var mainContainer = $("#mainContainer") + // Out + mainContainer.height(oldHeight) mainContainer.animate({ - height: "toggle", - opacity: 0 + // height: "toggle", + opacity: 0.25 }, 'fast', events) $.get(location + '?c', function (data) { html = data -- libgit2 0.21.2