I am trying to make a div both re-sizable and draggable with jquery.
However the implementation seems to be pretty buggy.
I found several similar questions, but no solution.
This is a problem with the UI draggable itself, the issue has already been reported here
The fixes in your case are (at least in the latest version of Chrome which I'm working on) to
paddingto the parent, demo found here
borderto the parent, demo found here
marginto the child, demo found here
overflow:hiddento the parent, demo found here. I have no idea why this one works, but it seems to do the job perfectly
The 5px threshold could be only pertinent to the example, some playing might be necessary in order to get the correct value in your actual case. Some other examples I saw needed less padding or border width, I suppose it's based on how large the elements are somehow, but I'm not sure. I did test the fifth solution in their examples and it seemed to work there as well