Questions tagged [html5-draggable]

HTML5 draggable is one of the HTML5 feature which allows users to drag and drop any element inside the page.

HTML5 draggable is a markup attribute that powers the Drag and Drop API; When set on an element like so "draggable="true"", it becomes an object that can be dragged and dropped across the ui, by the user.

82 questions
36
votes
7 answers

html5 draggable hide original element

When starting to drag an element using HTML5 draggable attribute, original element is still visible, so I end up having two elements visible instead of one. How can I do to have only the element being dragged visible (the original one should be…
julesbou
  • 5,570
  • 4
  • 31
  • 36
19
votes
1 answer

Drag dataTransfer data unavailable in ondragover event

I'm trying to get the hang of html5 drag and drop events. function rowDragStart(event) { let targetRowId = event.target.attributes.row.value; event.dataTransfer.setData("text/plain", targetRowId); } function rowDragOver(event) { …
Adam Rackis
  • 82,527
  • 56
  • 270
  • 393
14
votes
5 answers

javascript drag and drop page builder

I'm in the process of building an A4 size drag and drop page builder. The elements this builder can contain are images and text boxes. I am after for some advice on what frameworks are available that can be used to build this type of front-end…
TheDeveloper
  • 890
  • 1
  • 15
  • 37
11
votes
1 answer

JS HTML5 Drag and Drop: Custom Dock Effect Jumping Around in Chrome

Situation: I'm using HTML5 drag-and-drop to place tiles in a game I'm writing. I'd like to add an effect where the two tiles that I'm about to drop a new tile between move slightly apart to indicate that this is where you're dropping (similar to the…
10
votes
2 answers

Allow select text on a HTML 5 draggable child element

Having a table with draggable rows where each row is draggable=true, how can the user still be able to select text from a column? .. ..
.. Cool text but you can't select…
user1791567
  • 1,388
  • 1
  • 16
  • 29
9
votes
1 answer

Style drag ghost element

I am facing an issue, where I am dragging a div. While the ghost element looks good on MacOs(yes both on Chrome and FireFox),it appears to be too transparent,in Windows (yes both on Chrome and FireFox. I tried multiple approaches but nothing seems…
ishan srivastava
  • 363
  • 1
  • 3
  • 10
8
votes
2 answers

Programmatically fire HTML5 dragstart after mousemove

I am currently struggling with HTML5 drag'n drop as I'd like to achieve something specific. I have a div that can be dragged using the HTML5 API, but I only want the drag to occur if the user really means it (as it triggers some more handlers…
Vinky
  • 341
  • 7
  • 13
6
votes
1 answer

HTML5 Draggable setDragImage doesn't work with canvas on Chrome

I'm trying to use canvas as my drag image in native HTML5 Drag And Drop API. The problem is that it works on Firefox but not on Chrome (58) and I can't pinpoint the problem. Code: https://jsfiddle.net/196urLwd/5/
6
votes
1 answer

How can I make a nested element not draggable in a draggable container?

I'm using HTML5 drag and drop on a parent container, but I want to disable the drag effect on some of its children, specifically an input so that users can select/edit input content easily. Example: https://jsfiddle.net/Luzub54b/
zjabbari
  • 63
  • 1
  • 6
5
votes
1 answer

How to set custom data on html drag and drop

I'm trying to set a custom data which is an HTML element on my drag event. So far I did this: element.addEventListener('dragstart', event => { event.dataTransfer.setData('custom-data',…
bobharley
  • 662
  • 3
  • 17
4
votes
1 answer

How to make a draggable element stay at the new position when dropped (HTML5 not jQuery)?

I have just learned the basics of HTML5 draggable and droppable API. I do not know how to retain the dragged position at its dropped position. On dropping it changes its position. Here is the basic HTML (relevant elements only): onDragStart =…
asinix
  • 966
  • 1
  • 9
  • 22
4
votes
1 answer

browser response on dragover - html5 drag and drop

I am using html5 drag and drop. When I drag an image or link from any given webpage, the browser-window is recognizing the dragover event. For example dragging an image over a browser tab, makes the browser switching the window. Same works for…
Stefan
  • 1,041
  • 1
  • 14
  • 28
4
votes
0 answers

Need to remove the clone element in html5 drag and drop

I have a div element which I am able to drag however I wish to drop it in a specific div element. Here, I need to remove the dragged cloned element div while drag and also the original dragged element shouldn't be change. I used a custom helper div…
Priyanga V
  • 241
  • 2
  • 9
4
votes
1 answer

Cross-browser HTML5 Drag and Drop JSON DataTransfer fails

I came to notice that for some reason it is not possible to transfer data from chrome to firefox or viceversa through a draggable object when the mime is set to application/json. See demo here: http://jsfiddle.net/n7N9p/4/ (Open that link in both,…
d_inevitable
  • 4,381
  • 2
  • 29
  • 48
3
votes
2 answers

Drag and Drop - How to get the actual html in dragstart event and drop event

On dragstart event I want to get the actual html of dragged element. But when I do something like this in a dragstart event console.log( e.target); it give me the output like this as expected;

Nisar Ahmad
  • 113
  • 1
  • 1
  • 11
1
2 3 4 5 6