Created
December 23, 2016 13:07
-
-
Save jcubic/8504dfc220aaf378dc42ee9b44e381cf to your computer and use it in GitHub Desktop.
Implementation of "Using CSS Selectors as Fragment Identifiers" Unofficial Draft
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function jump() { | |
var match = location.hash.match(/^#css\((.*)\)$/); | |
if (match) { | |
window.scrollTo(0, document.querySelector(match[1]).offsetTop); | |
} | |
} | |
jump(); | |
window.addEventListener("hashchange", jump, false); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment