I am trying to create a div (green div) which can be dragged around but within the boundaries of another div (small div with border).
This is what I have tried till now.

[click here](http://jsfiddle.net/xt25du2j/3/)

I will try to explain in figure

```
I want this

```

![enter image description here](https://i.stack.imgur.com/8Gqos.jpg)

```
But not this

```

![enter image description here](https://i.stack.imgur.com/F0DGk.jpg)

Green div should be able to drag around but the limit should be the small div (white space should not be seen in small div) in all four corners like the figure above.