From 69beee99b272b3427d5abe19ac7a9eb17f17b59a Mon Sep 17 00:00:00 2001 From: Max Shenfield Date: Mon, 18 Jan 2016 01:23:36 -0600 Subject: [PATCH] Fix issue-61 preserve tutorial content height between transitions Use jquery [`fadeTo`](https://api.jquery.com/fadeTo/) instead of `fadeIn` and `fadeOut` to adjust opacity without changing content height. This has the nice effect of making the data look like it is being loaded from memory, hiding the server round trip from the user. --- resources/public/javascript/tryclojure.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/public/javascript/tryclojure.js b/resources/public/javascript/tryclojure.js index c6069fc..f362e27 100644 --- a/resources/public/javascript/tryclojure.js +++ b/resources/public/javascript/tryclojure.js @@ -60,9 +60,9 @@ function goToPage(pageNumber) { currentPage = pageNumber; var block = $("#changer"); - block.fadeOut(function(e) { + block.fadeTo("fast", 0, function(e) { block.load("/tutorial", { 'page' : pages[pageNumber] }, function() { - block.fadeIn(); + block.fadeTo("fast", 100); changerUpdated(); }); });