-
-
Save neyasbltb88/84669ef2138098004ad1a4dfb2b28448 to your computer and use it in GitHub Desktop.
Customize cursor resize for textarea
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
.resize { cursor: row-resize; } |
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
$("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