Created
August 25, 2013 09:00
-
-
Save imarkdesigns/6332820 to your computer and use it in GitHub Desktop.
Customize cursor resize for textarea
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
.resize { cursor: row-resize; } |
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
$("textarea").mousemove(function(e) { | |
var myPos = $(this).offset(); | |
myPos.bottom = $(this).offset().top + $(this).outerHeight(); | |
myPos.right = $(this).offset().left + $(this).outerWidth(); | |
if (myPos.bottom > e.pageY && e.pageY > myPos.bottom - 16 && myPos.right > e.pageX && e.pageX > myPos.right - 16) { | |
$(this).addClass('resize'); | |
} | |
else { | |
$(this).removeClass('resize'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment