open-stage-control/resources/theme/scripts.js
2019-03-27 14:15:14 +01:00

9 lines
344 B
JavaScript

var offset = 82
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)