Skip to content

Instantly share code, notes, and snippets.

@ndelangen
Created November 2, 2015 10:18
Show Gist options
  • Save ndelangen/648b6e3b4fdca2407a74 to your computer and use it in GitHub Desktop.
Save ndelangen/648b6e3b4fdca2407a74 to your computer and use it in GitHub Desktop.
(function ($) {
var elements = {
html: document.documentElement
body: document.body
};
$(elements.body).one('touchstart', function () {
$(elements.body).off('mouseenter.cursor-detection');
});
$(elements.body).one('mouseenter.cursor-detection', function () {
if (!navigator.userAgent.match(/Android/i)) {
$(elements.html).addClass('has-cursor');
}
});
}(jQuery));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment