AndrewWild (Talk | contribs) |
AndrewWild (Talk | contribs) |
||
Line 492: | Line 492: | ||
$('#logo_inverse').toggle(); | $('#logo_inverse').toggle(); | ||
}); | }); | ||
+ | //Smooth scrolling// | ||
+ | $('a[href^="#"]').on('click',function (e) { | ||
+ | e.preventDefault(); | ||
+ | |||
+ | var target = this.hash; | ||
+ | var $target = $(target); | ||
+ | |||
+ | $('html, body').stop().animate({ | ||
+ | 'scrollTop': $target.offset().top | ||
+ | }, 900, 'swing', function () { | ||
+ | window.location.hash = target; | ||
+ | }); | ||
+ | }); | ||
}); | }); | ||
</script> | </script> |
Revision as of 12:18, 31 August 2016