function open (event) {
var href = this.href;
var target = this.target === "_parent" ? window.parent : window;
-
- if (this.getAttribute('href')[0] === "#")
- scrollToId(this.getAttribute('href').slice(1));
- else
- target.location.href = this.href;
+ target.location.href = this.href;
event.preventDefault();
}
scrollToId(location.hash.slice(1));
});
+window.addEventListener('hashchange', function () {
+ scrollToId(location.hash.slice(1));
+});
+
window.addEventListener('DOMContentLoaded', function () {
if (navigator.standalone)
document.body.className += ' standalone';