Skip to content

Instantly share code, notes, and snippets.

View FirstWhack's full-sized avatar

Josiah FirstWhack

View GitHub Profile
@FirstWhack
FirstWhack / dropAnchor.js
Last active August 29, 2015 13:56
dropAnchor() - Secondary anchor `scrollIntoView()-er` for featured listings on a homepage
function dropAnchor(str) { // Eh...
var hash = str || window.location.hash || location.pathname.match(/\/features\/(.*)/)[1];
var links = document.getElementsByTagName('a');
var anchors = [];
for (var i in links) {
var name = links[i].name;
if (name) anchors.push(links[i]);
}
if (hash) {