Created
January 28, 2014 21:36
-
-
Save amboy00/8677022 to your computer and use it in GitHub Desktop.
Hunting anchors.
This file contains 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
//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'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Used for when links are within carousels or other divs that already have event handlers on them.