Improve scrolling

This commit is contained in:
Edin Dazdarevic
2017-12-17 23:20:46 +01:00
parent 9bb4aed8a7
commit d7601552e0
6 changed files with 12 additions and 7 deletions

View File

@@ -3,8 +3,12 @@ $('a.nav-link').click(function(e) {
var target = $($(this).attr("href"));
var marginTop = parseInt(target.css('paddingTop'), 10);
if (target.attr('id') === 'second') {
marginTop = -5;
marginTop = -10;
}
if (target.attr('id') === 'expertise') {
marginTop = 70;
}
$('html, body').animate({
scrollTop: target.offset().top - marginTop
}, 1000);