html - Apply Containment to Clone JQuery -


i want apply containment clone of image when dragged 1 div (keeping clone draggable).

the problem when image dragged , dropped div clone becomes un-draggable, inorder make draggable have called .draggable function calling loses containment attribute , become draggable everywhere. have tried best find solution can't find anything.

   $(function() {       $(".move-icon-class").draggable(     {      containment: '#screen',     helper:'clone',     revert: 'invalid',     scroll: false,     collision: 'fit flip',      }     );      $("#screen").droppable({       accept: '.move-icon-class',       activeclass: 'ui-state-hover',       hoverclass: 'ui-state-active',       drop: function(event, ui) {         dropped = true;         $.ui.ddmanager.current.cancelhelperremoval = true;         ui.helper.appendto(this).draggable(); // want apply containment       }     });    }); 

when assign draggable within drop, want set containment option @ time.

ui.helper.appendto(this).draggable({   containment: '#screen' }); 

this set containment again.


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -