Add "helper" to draggable on drag event.

Add "helper" to draggable on drag event.


How to add clone helper to draggable div conditionally

For example,

I have two container divs.
I do have a draggable div in one of the container div.

Now if i drag my div within the parent container , no clone is needed. But, if i drag the div outside of my parent container, clone needs to be added .

How can i do this on on drag event ?