- I try to create movable and resizable div using pure javascript
- the resizable div have 4 handler in corner to control it e.g :
- northeast : a div located in y=0, x=0;
- northwest : a div located in y=0,x = max parent width;
- southwest : a div located in y=max parent height, x = max parent width
- southeast : a div located in y=max parent height,x = 0
(note: the handler location is relative to parent, the parent is the resizable div)
I'm getting difficulties with the logic to resizable..
Here's what I try
- when user click the div, I insert it 4 div (use as handler) (this happen at event onmousedown)
now the handler will do the job
northeast:
I don't know the logic
north west
I don't know the logic
my suggest : when user move this handler towards
y axis : the parent y position will equal to y position of this handler(but the height is weird)
x axis : the parent width will equal to x position of this handler
south west:
when user move this handler towards
y axis : the parent height will equal to y position of this handler
x axis : the parent width will equal to x position of this handler
south east:
I don't know the logic
my suggest : when user move this handler,
- y axis : the parent height will equal to y positon of handler.
- x axis : the parent x position will equal to x position of handler. (but the width is weird, this is that bug me out)
(Note : the handler position = absolute)
I already goggle but I still can't solve it.
What to do?
Apologize can't post a code because in actual I have 8 handler and my code is untidy.