subjx icon indicating copy to clipboard operation
subjx copied to clipboard

Can we add new div while first time onMove() method?

Open sraza295 opened this issue 1 year ago • 1 comments

subjx('.clone').clone({
    stack: '#container',
    appendTo: '#stack',
    onInit(el) {
    },
    onMove(dx, dy) {
    },
    onDrop(e, el, clone) {
    },
    onDestroy() {
    }
});

when onMove method starts, can we change the style of div or can we change the div on the fly? suppose below is the HTML initial element which is drags <div class='clone clonable'>Start Drag</div>

and when onMove() method start, i want to edit the above HTML like this.

<div class='clone clonable'>
    <img id="signature-LDNRHuZkQx" style="background: rgb(255, 214, 91); opacity: 0.8; border: 1px solid rgb(255, 255, 118); border-radius: 5px; width: 400px; height: 100px">
</div>

@nichollascarter @semantic-release-bot @fatihkutuk @sysmaya

sraza295 avatar Apr 24 '23 12:04 sraza295

@sraza295 you can access to the elements within onInit or onMove methods:

subjx('.clone').clone({
    stack: '#container',
    appendTo: '#stack',
    onInit(elements) {
      console.log(elements);
    },
    onMove(dx, dy) {
      console.log(this.elements);
    }
});

nichollascarter avatar Apr 28 '23 09:04 nichollascarter