Last active
April 11, 2019 15:15
-
-
Save gtempesta/f5ba14f4ca6613e73cfbbc56e6f413f6 to your computer and use it in GitHub Desktop.
hover state in iOS
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
// If you need to have a different appearance on hover in iOS | |
// you have to simulate it by toggling a class on touchstart/touchend | |
// and then style the element accordingly | |
// source: https://stackoverflow.com/a/2891155/ | |
$('.hovered-element').on('touchstart touchend', function () { | |
$(this).toggleClass('touch-hover'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment