From 7aeab6d8d7deded1104bbe3966d8c3b890e180ac Mon Sep 17 00:00:00 2001 From: Alexander Zolotarev Date: Tue, 15 Oct 2013 14:17:12 +0300 Subject: [PATCH] Fixed js section animation --- data/js/article.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/data/js/article.js b/data/js/article.js index 6b43f30..e54c60c 100644 --- a/data/js/article.js +++ b/data/js/article.js @@ -52,10 +52,10 @@ function onSectionClick(event) { sectionToClose.className = next(sectionToClose).className = ""; }); - animateScroll(this, 200); - this.className = contentSection.className = "openSection"; + animateScroll(this, 200); + } else { this.className = contentSection.className = ""; } @@ -87,8 +87,6 @@ function animateScroll(element, duration) { if (duration < 0) return; var yLeft = element.getBoundingClientRect().top; - if (yLeft <= 0) - return; var dy = yLeft / duration * ANIMATION_INTERVAL; window.scrollBy(0, dy);