Last active
December 31, 2015 05:09
-
-
Save lyonsun/7938752 to your computer and use it in GitHub Desktop.
prevent anchor link drag-drop and redirect link on touch screen.
This file contains hidden or 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
// prevent text selection in IE | |
document.onselectstart = function () { return false; }; | |
// prevent anchor link drag. | |
$('selector').mousedown(function(event) { | |
event.preventDefault(); | |
}); | |
// redirect link. | |
$('selector').mouseup(function(event) { | |
location.href = $(this).parent().attr('href'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment