From 516debac2abfaaae86387dc64ba799b8a7a3b7f8 Mon Sep 17 00:00:00 2001 From: Arvind Singh Date: Mon, 19 Nov 2018 17:49:54 +0530 Subject: fix form submission --- layouts/partials/contact.html | 2 +- static/js/script.js | 19 ++++++------------- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/layouts/partials/contact.html b/layouts/partials/contact.html index bb96c89..91fb989 100644 --- a/layouts/partials/contact.html +++ b/layouts/partials/contact.html @@ -55,7 +55,7 @@
- +
diff --git a/static/js/script.js b/static/js/script.js index 7ee9d02..a745a9b 100644 --- a/static/js/script.js +++ b/static/js/script.js @@ -55,19 +55,12 @@ $(document).ready(function(){ }); //Smooth scroll - $("a, button").click(function(event){ - if($(this).attr('type') != 'submit'){ - if(this.hash !== ""){ - event.preventDefault(); - var hash = this.hash; - - $("html, body").animate({ - scrollTop: $(hash).offset().top - }, 800, function(){ - window.location.hash = hash; - }) - } - } + $('a').click(function(){ + var hash = $(this).attr('href').split('#')[1]; + $('html, body').animate({ + scrollTop: $('#' + hash).offset().top + }, 500); + return false; }); -- cgit v1.2.3