I'm trying to call a function right at the start of dragging but I can't, this div can't handle click or mousedown events on the resize icon area so I'm forced to handle it on mouseover event.
HTML
<div>hey</div>
CSS
div{
width:30%;
border:4px solid green;
resize:horizontal;
overflow:hidden;
}
Javascript
$("div").on("mousemove.resizer",function(e) {
var draggingstarted = false;
var bottom = $(this).offset().top + $(this).outerHeight();
var right = $(this).offset().left + $(this).outerWidth();
if (e.pageY<bottom-3 && e.pageY>bottom-16
&& e.pageX<right-3 && e.pageX>right-16){
if (draggingstarted){
console.log("started dragging");
} else if (e.which==1) draggingstarted=true; //left click
//else if (e.which==0) draggingstarted=false; //no clicks
console.log(e.which, draggingstarted);
}
});