Skip to content

Instantly share code, notes, and snippets.

@mikeriley131
Last active September 19, 2017 21:51
Show Gist options
  • Save mikeriley131/4e6ba02d12031f2c4b117c5f0b5dc1aa to your computer and use it in GitHub Desktop.
Save mikeriley131/4e6ba02d12031f2c4b117c5f0b5dc1aa to your computer and use it in GitHub Desktop.
Overcome the need to double-tap on a button with :hover:before or :hover:after on iOS
var styledLink = document.querySelectorAll('.button-link'),
i;
for (i = 0; i < styledLink.length; ++i) {
styledLink[i].addEventListener('touchend', function(e) {
window.location = this.attr('href');
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment