I noticed that the resize button on my text area when hovered and/or clicked is staying as an arrow.
It seems to me like it should be a pointer.
seeing as there is css to remove or add the resize tool to a textarea,
resize:none;
and css to change the cursor of the whole textarea,
cursor:pointer;
but it seems like there should be a css parameter to control the cursor of just the resize button. I've been looking around a bit and can't seem to find the property though. I can think of a few ways to do this in javascript or jquery but seems like overkill.
So is there a way to set the cursor for just the resize button of a textarea via css?
There is a simple way in jQuery to deal with this issue.
<script type="text/javascript">
$(function() {
$(document).on('mousemove', 'textarea', function(e) {
var a = $(this).offset().top + $(this).outerHeight() - 16, // top border of bottom-right-corner-box area
b = $(this).offset().left + $(this).outerWidth() - 16; // left border of bottom-right-corner-box area
$(this).css({
cursor: e.pageY > a && e.pageX > b ? 'nw-resize' : ''
});
})
});
</script>
See jsFiddle
One line
$(document).on('mousemove', 'textarea', function(e) { var a=$(this).offset().top+$(this).outerHeight()-16,b=$(this).offset().left+$(this).outerWidth()-16;$(this).css({cursor:e.pageY>a&&e.pageX>b?"nw-resize":""}); })
This is rendered by the browser itself and is not part of HTML, therefore it cannot be styled via CSS.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With