1 // Copyright (c) 2009-2011 by Kris Maglione <kris@vimperator.org>
3 // This work is licensed for reuse under an MIT license. Details are
4 // given in the LICENSE.txt file included with this file.
7 function checkFragment() {
8 document.title = document.getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "title")[0].textContent;
11 content.scrollTo(0, content.scrollY + elem.getBoundingClientRect().top - 10); // 10px context
14 var frag = document.location.hash.substr(1);
16 var elem = document.getElementById(frag);
19 setTimeout(action, 10);
24 document.addEventListener("load", checkFragment, true);
25 document.addEventListener("hashChange", checkFragment, true);
27 // vim: set fdm=marker sw=4 ts=4 et: