[QUESTION] How can I specify position for dragging elements ?
Question
Hi iam doing a project with this library and i want to specify position for dragging components in it for example i have a div with id="drag-here" i want all components to be dragged in this div only
i hope you can understand me , thank you all
Answers (3)
i don't have components iam using blocks
according to this:
i have a div with id="drag-here"
i assume your block is something like this:
content: '<div id="drag-here"></div>'
the approach for your container block would be:
editor.BlockManager.add('drag-here',{
lablel:'Drag Here',
content:'<div id="drag-here" data-gjs-droppable="true" style="width:100px;height:100px; background:red;"></div>'
})
and for target blocks:
editor.BlockManager.add('drop',{
lablel:'Drop',
content:'<div data-gjs-draggable="div#drag-here" style="width:50px;height:50px; background:blue;"></div>'
})
cheers!
i have a div with id="drag-here" i want all components to be dragged in this div only
if by this you mean you want all components to be draggable only in your target component, you can use draggable property.
by specifying draggable on your components like this:
draggable: 'target, target *'
cheers!
by specifying draggable on your components like this:
thank you for fast replay , but i don't have components iam using blocks
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1464
Customizing the Component Position
First of all thank you guys for this awesome library, And I have one Clarification that is how do i customize the drop position example if...
Issue #3251
How can I specify position of dropped element ?
I want to specify the position of dragging element. for example, if I have a header block which no matter where you drag, it should be plac...
Issue #2061
[QUESTION] How to place a component at the end of the canvas.
How can I put my footer at the end of the canvas? I want the editor to not allow placing a block/widget below the footer. example
Issue #1994
[question] Is it possible to add StyleManager property for only class name
Thank for this awesome library. I am gonna to add style controller to sector. This style will be for only one class name and won't set targ...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.