Skip to content

Instantly share code, notes, and snippets.

@amboy00
Created January 28, 2014 21:36
Show Gist options
  • Save amboy00/8677022 to your computer and use it in GitHub Desktop.
Save amboy00/8677022 to your computer and use it in GitHub Desktop.
Hunting anchors.
//This is how we make the link work.
var el = ev.target;
while (el.parentNode) {
el = el.parentNode;
if (el.nodeName == 'A') {
window.location.href = el.getAttribute('data-href');
}
}
@amboy00
Copy link
Author

amboy00 commented Jan 28, 2014

Used for when links are within carousels or other divs that already have event handlers on them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment