Fix: Scroll down button not working

This commit is contained in:
Dorian Zedler 2022-01-13 12:34:53 +01:00
parent d7ec721045
commit 23b195abe7
Signed by: dorian
GPG key ID: 989DE36109AFA354
2 changed files with 6 additions and 9 deletions

View file

@ -7,17 +7,14 @@
{{ block "header" . }}
{{ partial "header.html" . }}
{{ end }}
{{ block "hero" . }}{{ end }}
<section id="start">
{{ block "body" . }}
<section id="body-wrapper" class="section">
<section class="container {{ .Site.Params.GridSize }}">
{{ block "content" . }}{{ end }}
</section>
{{ block "body" . }}
<section id="body-wrapper" class="section">
<section class="container {{ .Site.Params.GridSize }}">
{{ block "content" . }}{{ end }}
</section>
{{ end }}
</section>
{{ end }}
</div>
{{ block "footer" . }}

View file

@ -36,7 +36,7 @@ jQuery(document).ready(function($){
//Smooth scroll to start
$('#to-start').click(function(){
var start_y = $('#start').position().top;
var start_y = $('#to-start').position().top + $('#to-start').height();
var header_offset = 45;
window.scroll({ top: start_y - header_offset, left: 0, behavior: 'smooth' });
return false;