Fixed navbar scroll spy
This commit is contained in:
parent
6dc9d1d33d
commit
960f8ca94c
2 changed files with 8 additions and 4 deletions
|
@ -5,6 +5,10 @@
|
||||||
@include transition();
|
@include transition();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
.top-navbar {
|
.top-navbar {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
left: 0;
|
left: 0;
|
||||||
|
|
|
@ -77,9 +77,9 @@
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<div class="collapse navbar-collapse dynamic-navbar" id="top-nav-items">
|
<div class="collapse navbar-collapse dynamic-navbar" id="top-nav-items">
|
||||||
<ul class="navbar-nav ml-auto">
|
<ul class="nav navbar-nav ml-auto">
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="{{ site.BaseURL | relLangURL }}#home">{{ i18n "home" }}</a>
|
<a class="nav-link" href="#home">{{ i18n "home" }}</a>
|
||||||
</li>
|
</li>
|
||||||
{{ if $sections }}
|
{{ if $sections }}
|
||||||
{{ $sectionCount := 1 }}
|
{{ $sectionCount := 1 }}
|
||||||
|
@ -88,7 +88,7 @@
|
||||||
{{ $sectionCount = add $sectionCount 1}}
|
{{ $sectionCount = add $sectionCount 1}}
|
||||||
{{ if le $sectionCount $maxVisibleSections }}
|
{{ if le $sectionCount $maxVisibleSections }}
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="{{ site.BaseURL | relLangURL }}#{{ partial "helpers/get-section-id.html" . }}">{{ .section.name }}</a>
|
<a class="nav-link" href="#{{ partial "helpers/get-section-id.html" . }}">{{ .section.name }}</a>
|
||||||
</li>
|
</li>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
@ -102,7 +102,7 @@
|
||||||
{{ if and (.section.enable) (.section.showOnNavbar) }}
|
{{ if and (.section.enable) (.section.showOnNavbar) }}
|
||||||
{{ $sectionCount = add $sectionCount 1}}
|
{{ $sectionCount = add $sectionCount 1}}
|
||||||
{{ if gt $sectionCount $maxVisibleSections }}
|
{{ if gt $sectionCount $maxVisibleSections }}
|
||||||
<a class="dropdown-item" href="{{ site.BaseURL | relLangURL }}#{{ partial "helpers/get-section-id.html" . }}">{{ .section.name }}</a>
|
<a class="dropdown-item" href="#{{ partial "helpers/get-section-id.html" . }}">{{ .section.name }}</a>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue