I want to apply the same element of re-sizing to an element with my own action handlers? Lets look at the code.
This is my regular resizable handler, any element with the class .resizable
will be resizable with the provided param's (animate,grid,zIndex
).
$('.resizable').resizable({
animate: true,
grid: [$(this).width(),$(this).height()],
zIndex: 0
});
Now my custom event. I want it to simulate the above as the mouse moves. Comment explain it further.
$("#main").on('mousedown', function(e){
// Create an new image element
// and append it to the #danka div
// and apply an mousemove event.
appendTo('#danka').on("mousemove", function(e){
// I need it so; as the mouse moves,
// it simulate the .resizable() event,
// created above with all param.
});
});
Basically I trying to take the mouse move (track mouse position) and pass it to the .resizable() event to take care of the actual re-sizing.
Is this possible? I looked at trigger()
but can't seem to see how it would work?
Thanks.