Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sraza295 opened this issue Apr 24, 2023 · 1 comment
Open

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

sraza295 opened this issue Apr 24, 2023 · 1 comment

Comments

@sraza295
Copy link

sraza295 commented Apr 24, 2023

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

@nichollascarter
Copy link
Owner

@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);
    }
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants