TEXTAREA Event Resize

0

I want a way to get the textArea event when it is clicked on its resize arrow.

    
asked by anonymous 06.02.2018 / 02:20

1 answer

2

With event mousemove you can detect when textarea is resized by storing current dimensions as variables:

var largura = $("textarea").width();
var altura = $("textarea").height();
$("textarea").on("mousemove", function(){

    var larg_atual = $(this).width();
    var altu_atual = $(this).height();

    if(larg_atual != largura || altu_atual != altura){
        largura = larg_atual;
        altura = altu_atual;
        console.log("Tamanho alterado");
    }

});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<textarea></textarea>
    
06.02.2018 / 02:58