From caa4ec3b6f28bd399ce16f420f144db028bfc446 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Je=CC=81re=CC=81my=20Fabre?= Date: Tue, 8 Nov 2016 11:59:25 +0100 Subject: [PATCH] Smooth scroll on summary links --- app/static/src/js/modules/summary.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/static/src/js/modules/summary.js b/app/static/src/js/modules/summary.js index 9db79ef8..ae0a8b5a 100644 --- a/app/static/src/js/modules/summary.js +++ b/app/static/src/js/modules/summary.js @@ -30,6 +30,17 @@ Summary.prototype.init = function() { $template_clone.find('a').attr('href', '#section-' + sectionCount); $template_clone.removeClass('hide'); + $template_clone.find('a').bind('click', function(e) { + + e.preventDefault(); + var self = $(this); + $('html, body').animate({ + scrollTop:$(self.attr('href')).offset().top + }, 'slow'); + return false; + + }); + that.$links.push($template_clone.find('a')); that.$summary.append($template_clone); -- 2.39.5