Comments on: Native Drag and Drop https://stevefaulkner.github.io/html5doctored/native-drag-and-drop/ helping you implement HTML5 today Thu, 28 Jul 2016 17:36:34 +0000 hourly 1 By: GR https://stevefaulkner.github.io/html5doctored/native-drag-and-drop/#comment-151353 Thu, 24 Jul 2014 20:12:07 +0000 http://html5doctor.com/?p=397#comment-151353 You don’t need all that mumbo jumbo to drag & drop!
Just a couple of lines of code will do…

function MoveItem(Which){
X=event.clientX+window.pageXOffset;
Y=event.clientY+window.pageYOffset;
document.getElementById(Which).style.left=X+’px’;
document.getElementById(Which).style.top=Y+’px’;
}

Hello

]]>
By: Jaimin Patel https://stevefaulkner.github.io/html5doctored/native-drag-and-drop/#comment-131761 Fri, 18 Jul 2014 19:01:58 +0000 http://html5doctor.com/?p=397#comment-131761 http://html5demos.com/h5utils.js is not available.

]]>
By: Jim https://stevefaulkner.github.io/html5doctored/native-drag-and-drop/#comment-42723 Thu, 05 Dec 2013 17:29:12 +0000 http://html5doctor.com/?p=397#comment-42723 Most drag and drop tutorials explain everything perfectly, including yours, but nowhere can I find how to identify the source div (this is the div which is vacated in drag and drop), so that I can compare it with the target div with a view to allowing or preventing a drop onto a certain element.
I have set up a chequers board, playing squares as per chequers by using CSS boxes. I have four red pieces (drag1, drag2 and so on) and one green piece (drag5).
The drag5 piece can be moved x + or – the width of a square and y + or – the height of a square. (In other words up or down the board.) The other four pieces can move only down the board, i.e.,
x + or – one square width and y + one square height.
At present I can move any piece onto any playing square.
If a piece were to be moved from square 6 my math would be:
if source – target = -3, -4, +4 or +5 green could be moved onto any of squares 2, 3, 10 or 11;
if source – target = +4 or +5 a red piece could be moved onto only 10 or 11.
I also need to prevent moves to an already occupied square and to control the sequence of moves (green, red, green…….) with a counter.
I am a teacher of English as a foreign language and need to create suitable materials such as games, multi-choice quizzes for my foreign students.
Your help will be greatly appreciated!

]]>
By: Janp https://stevefaulkner.github.io/html5doctored/native-drag-and-drop/#comment-39770 Thu, 14 Nov 2013 14:30:38 +0000 http://html5doctor.com/?p=397#comment-39770 How can I clear the text block each time I drag and drop an image.

]]>
By: Martijn https://stevefaulkner.github.io/html5doctored/native-drag-and-drop/#comment-37048 Wed, 31 Jul 2013 18:54:06 +0000 http://html5doctor.com/?p=397#comment-37048 Just letting you know you can now do this with jQuery, since it allows access to the native event object via the originalEvent property.

]]>
By: Ken Hikage https://stevefaulkner.github.io/html5doctored/native-drag-and-drop/#comment-35435 Mon, 24 Jun 2013 21:26:45 +0000 http://html5doctor.com/?p=397#comment-35435 Just wanted to note that your advanced example is missing a ‘.


this.innerHTML += '<a href="' + person.blog + '" rel="nofollow">' + person.name + '</a>';

]]>
By: HTML5 APIs程序员指南 | java交流网 https://stevefaulkner.github.io/html5doctored/native-drag-and-drop/#comment-34789 Sun, 02 Jun 2013 01:11:28 +0000 http://html5doctor.com/?p=397#comment-34789 […] Native, Drag and Drop, HTML5 Doctor, Remy Sharp […]

]]>
By: sylvain https://stevefaulkner.github.io/html5doctored/native-drag-and-drop/#comment-34535 Thu, 16 May 2013 07:40:22 +0000 http://html5doctor.com/?p=397#comment-34535 Hello,

I checked “drag icon” demo on different browsers. It works fine for most of them except for IE10.
on IE10, default image is used (instead of twitter icon). So, it seems setDragImage is inoperative for IE. Am I wrong ? Which workaround can be used for IE ? any idea ?

Thank you for this article

Best Regards
Sylvain

]]>
By: Andrew https://stevefaulkner.github.io/html5doctored/native-drag-and-drop/#comment-33096 Tue, 02 Apr 2013 11:18:25 +0000 http://html5doctor.com/?p=397#comment-33096 I’m always happy when I can beat IE’s limitations and struggle on to the next problem (currently IE jsonp error responses).

This DnD example helped me successfully drop external links onto an Explorer window so I can process them. What I cannot fathom out though is why the event occurs twice? Has anyone else seen this happening?

]]>
By: HTML 5 Drag and Drop and Automatically Send to the Server - Neweb https://stevefaulkner.github.io/html5doctored/native-drag-and-drop/#comment-32788 Fri, 29 Mar 2013 08:03:34 +0000 http://html5doctor.com/?p=397#comment-32788 […] Just as a forewarning, drag-and-drop has been known to be a bit of a killjoy. In fact, it’s a nightmare, but I won’t repeat what’s been saidbefore. […]

]]>