drag-and-drop

jquery validation based on drag & dropped items

余生长醉 提交于 2019-12-23 03:56:04
问题 I'm trying to learn about jquery as much as possible, looking at many examples around the web, but still got problem with events. As you can see, I made a simple drag&drop thing using jquery UI, but all examples I found arround didn't help me with validating this. I created correctAnswers but the problem is I have no idea how to validate them. As it's easy to see, 'a' goes to 1, 'b' goes to 2, and 'c' goes to 3, and when I click 'submit' button it validates. var correctAnswers = ['a-1,b-2,c-3

How to implement detection of a View being dragged over another view?

回眸只為那壹抹淺笑 提交于 2019-12-23 03:32:11
问题 I want to have a draggable view, while being able to constantly monitor distance to the "target" view and to detect when draggable view is dragged over target view. My idea was to get Rect's of both views and to use intersect() to check if they are touching. However my implementation doesnt work smoothly - sometimes it detects overlap in wrong location or doesnt detect the end of overlapping. Could you tell me what I'm doing wrong or maybe lead to correct way of doing it? (I cant use

How to implement detection of a View being dragged over another view?

血红的双手。 提交于 2019-12-23 03:32:08
问题 I want to have a draggable view, while being able to constantly monitor distance to the "target" view and to detect when draggable view is dragged over target view. My idea was to get Rect's of both views and to use intersect() to check if they are touching. However my implementation doesnt work smoothly - sometimes it detects overlap in wrong location or doesnt detect the end of overlapping. Could you tell me what I'm doing wrong or maybe lead to correct way of doing it? (I cant use

Cannot get dropped folder information in FIrefox 48

人盡茶涼 提交于 2019-12-23 03:25:17
问题 I cannot get dropped folder information, in Firefox 48, Windows 10. event.dataTransfer.files.length is 0, when I drop folder. It works fine when I drop file. If you know a recommended method to get dropped folder information, I wish to know it. You can reproduce it in https://jsfiddle.net/0GiS0/4ZYq3/. 来源: https://stackoverflow.com/questions/38757322/cannot-get-dropped-folder-information-in-firefox-48

KineticJS drag and drop from one layer to another

大城市里の小女人 提交于 2019-12-23 03:25:12
问题 For now, I have a stage, two layers and images drawn on the leftLayer. I made the images draggable by adding the property draggable: true . All the drag and drop samples that I found (kinetic docs, tutorials, jsfiddles...) are within the same area. How can I do to make items who are drawn on the left layer be dropped only in the right layer , else, make them revert like in jquery (if it's implementable)? This is the jsfiddle that I'm editing. Help! 回答1: What you need to do is clone the object

Swap elements in a GridView

两盒软妹~` 提交于 2019-12-23 03:21:46
问题 I'm writing a QML program that is essentially a 4x4 GridView filled with numbered rectangles. I would like to be able to: Swap two elements from the grid, dragging and dropping Allow swap only for directly adjacent elements My current problem is that as soon as I drag an element on top of another, the whole grid adjusts positions filling the gap where the element originally was. Is there any way to avoid the auto adjust behavior for that type of grid? I'm aware that the piece of code below

Swap elements in a GridView

耗尽温柔 提交于 2019-12-23 03:21:32
问题 I'm writing a QML program that is essentially a 4x4 GridView filled with numbered rectangles. I would like to be able to: Swap two elements from the grid, dragging and dropping Allow swap only for directly adjacent elements My current problem is that as soon as I drag an element on top of another, the whole grid adjusts positions filling the gap where the element originally was. Is there any way to avoid the auto adjust behavior for that type of grid? I'm aware that the piece of code below

Implement IDropTarget

可紊 提交于 2019-12-23 03:20:11
问题 I would like to drag and drop files from windows explorer onto my application which is being built in Codegear RAD studio 2009. Then I would like to be able to access data from the object I am dragging and dropping. I believe I have to implement IDropTarget. Can someone please provide an example of how I might implement IDropTarget to achieve this? 回答1: There is a nice example written by Michael Dunn over at codeproject.com which shows how to implement IDropTarget and access data from inside

How to drag-and-drop on custom Swing components

北城余情 提交于 2019-12-23 03:18:30
问题 How can I implement drag and drop on custom components, e.g. my own JPanel subclasses? What I need is full Swing-like drag and drop support. With TransferHandlers , DropTargetListeners etc. So the trivial mousePressed() and mouseReleased() is not what I'm looking for. 回答1: Perhaps Lesson: Drag and Drop and Data Transfer. 来源: https://stackoverflow.com/questions/2990634/how-to-drag-and-drop-on-custom-swing-components

.NET Drag and drop ; Show dragged borders or image such as Windows do

六眼飞鱼酱① 提交于 2019-12-23 03:10:23
问题 I was wondering if there is a way (there is always a way) or what are best approach you have to show either of the borders of my controls or an image of what user is currently draging and dropping? I only drag from within my own app so not from desktop. I would like to have somethings similar to : I used to try to manually draw lines to "fake" the fact that this is my control's borders and It works fine... but I had hard time showing them over others form's controls as this is a huge form