Separate out navbar stuff.

This commit is contained in:
Quantum 2018-11-26 21:15:29 -05:00
parent 75947b03a5
commit ab4b249aa6
2 changed files with 14 additions and 13 deletions

View file

@ -1,15 +1,3 @@
import './app.scss'
import $ from 'jquery/dist/jquery'
import 'bootstrap/js/dist/util'
import 'bootstrap/js/dist/scrollspy'
import './clipboard'
$(() => {
$('#nav-anchors').find('a.nav-link').click(function () {
const $dest = $($(this).attr('href'))
$('html, body').animate({
scrollTop: $dest.offset().top - 72
}, 500)
return false
})
})
import './navbar'

13
src/navbar.js Normal file
View file

@ -0,0 +1,13 @@
import $ from 'jquery/dist/jquery'
import 'bootstrap/js/dist/util'
import 'bootstrap/js/dist/scrollspy'
$(() => {
$('#nav-anchors').find('a.nav-link').click(function () {
const $dest = $($(this).attr('href'))
$('html, body').animate({
scrollTop: $dest.offset().top - 72
}, 500)
return false
})
})