0

is it possible to drag child element from parent element without parent element is overflowing?, its like i want to create a drag and drop event out from parent element but it keeps on overflowing, if its not possible? what else can i do?

current example code:

 <div id="parent">
   <div id = "child">Drag me out from parent!</div>
 </div>



 <script>

  $("#child").draggable();

 </script>

Ive tried different revisions but it doesnt work well, Im looking forward to this, thanks!

Lumi Lu
  • 3,289
  • 1
  • 11
  • 21

1 Answers1

0

Maybe you can create your own draggable

$('#child').on('mousedown',function(){
    $('child').css('position','fixed');
    var evt=setInterval(followMouse, 50);

    $('child').on('mouseup',function(){
        clearInterval(evt);
        $('child').off('mouseup');
    });
});

function followMouse(){
    // mousePosX & Y must be a string ex: 345px
    $('child').css('left',mousePosX
    'top',mousePosY
    );
}