Search the Community
Showing results for tags 'drag and drop'.
-
Hi, I have a script that works properly, shows an image and you can drag and drop that image. But my problem is: how I can add more images? I thought copying the code would appear another image, but it is not. Thank you. <script src="http://d3lp1msu2r81bx.cloudfront.net/kjs/js/lib/kinetic-v5.0.2.min.js"></script><script defer="defer">function drawImage(imageObj) { var stage = new Kinetic.Stage({container: "container",width: 800,height: 600});var layer = new Kinetic.Layer();// darth vadervar darthVaderImg = new Kinetic.Image({image: imageObj,x: 100,y: 30,width: 40,height:
-
I tried one of w3schools tried-and-true "tryit"s in the up-to-date version of Chrome and it didn't work. Here it is: http://www.w3schools.com/html/tryit.asp?filename=tryhtml5_draganddrop But it works in Firefox and Safari. This close-cousin demo http://www.w3schools.com/html/tryit.asp?filename=tryhtml5_draganddrop2 also fails in Chrome but not in FF or Safari. But when I tried this similar drag and drop demo in Chrome: http://html5demos.com/drag it worked and it also works in FF and Safari. Any ideas why the two W3 demos don't work in Chrome? Maybe my Chrome preferences are slightly wron
- 4 replies
-
- drag and drop
- Javascript
-
(and 1 more)
Tagged with:
-
There are 2 images, and 2 locations, lets named it img1, img2, loc1, and loc2. What im trying to do is drag and drop img1 to loc1, which mean i don't want img1 to be drop in loc2, i want the specific image drop on specific location. function dropIn(evt){var root = document.getElementsByTagName("body")[0];evt.preventDefault();var id = evt.dataTransfer.getData("text");if(ev.target.getAttribute('data-drop') == id)ev.target.appendChild(document.getElementById(id));}<div id="box1" style="position: absolute; top: 220px; left: 220px;" ondragover="dragIn();" ondrop="dropIn();" ><img id="img1
- 1 reply
-
- javascript
- drag and drop
-
(and 1 more)
Tagged with:
-
I know that HTML5 provides Drag and Drop and is a powerful tool for it. However I just used it successfully for dragging and dropping HTML elements, HTML codes and Files. What other thing can I do with this feature? For example can I drag an address from the address bar and drop it on a text box? or can I do it reversely?
-
- html5
- drag and drop
-
(and 2 more)
Tagged with: