open-stage-control/resources/theme/scripts.js
2019-03-28 09:40:16 +01:00

9 lines
344 B
JavaScript

var offset = 80
function offsetScroll(){
if (document.location.hash) {
var el = document.getElementById(document.location.hash.substring(1))
if (el) document.body.scrollTop = document.documentElement.scrollTop = el.offsetTop - offset
}
}
window.addEventListener('hashchange', offsetScroll)
setTimeout(offsetScroll, 250)