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" . }} {{ block "header" . }}
{{ partial "header.html" . }} {{ partial "header.html" . }}
{{ end }} {{ end }}
{{ block "hero" . }}{{ end }}
<section id="start"> {{ block "body" . }}
{{ block "body" . }} <section id="body-wrapper" class="section">
<section id="body-wrapper" class="section"> <section class="container {{ .Site.Params.GridSize }}">
<section class="container {{ .Site.Params.GridSize }}"> {{ block "content" . }}{{ end }}
{{ block "content" . }}{{ end }}
</section>
</section> </section>
{{ end }}
</section> </section>
{{ end }}
</div> </div>
{{ block "footer" . }} {{ block "footer" . }}

View file

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