'Dragula drag and drop with Iframe

How to implement Dragula drag and drop plugin with Iframe

I just want to drop into an iframe and do the sortable option - fiddle

<div id="left">
     <span>test1</span>
     <span>test2</span>
     <span>test3</span>
</div>

<iframe style="width:100%;"></iframe>

javascript

let iFrameWebsite = $("iframe")[0].contentWindow.document;
$(iFrameWebsite).find('body').append('<div id="right">')

let b  = $(iFrameWebsite).find('body #right');
$(b).css({'width':'100%','height': '100px', 'border': '1px solid green' })


dragula([$("#left")[0], b[0] ]);

console result is same - console.log($("#left")[0], b[0])



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source