drag-and-drop

How do I highlight a droppable area on hover using jquery ui draggable

白昼怎懂夜的黑 提交于 2019-12-18 12:06:06
问题 I actually have two questions, the on in the title being the main one. I have multiple div elements on the page marked as droppable. Inside these div elements I have spans that are marked as draggable. I want it so when you are dragging an element and it is hovered over a droppable area that area either highlights or has a border so they know they can drop it there. As secondary question, all my draggable elements have a display:block, a width and a float on them, so they look nice and neat

Passing path to uploaded file from HTML5 drag & drop to input field

大兔子大兔子 提交于 2019-12-18 11:55:12
问题 I'm working on an application (in Node.js, which is irrelevant for this case) which allows the user to upload an image. It works fine using a form with an input (type="file") field. However, what I want is to be able to upload an image using HTML5 drag and drop instead. As far as i've come it's possible to drag an image to the client, and the image thumbnail is displayed in a div. However I really need some help with getting the file upload working. The thing is that I want to use the form

Drag & Drop on Safari iOS: Won't drag, won't respond to drop on desktop/iPad

浪尽此生 提交于 2019-12-18 11:48:28
问题 I am coding a webpage to be viewed on iPad. It uses Safaris/Webkits drag & drop. I have exactly copied Safari's example drag & drop code but it won't work. My Problem: The ondrop event is never triggered when I run the webpage (HTML, CSS & Javascript) on Safari Desktop or on Safari on an iPad. On ipad I cannot even drag the elements (the microscope thingie appears & it won't drag when I hold & move my finger over the element). The drag does work on desktop though. What's going wrong? The

How can I wrap text around a moveable image?

寵の児 提交于 2019-12-18 11:48:05
问题 I am trying to implement an interface where users can dynamically enter text and upload images. I wish for the interface to have these features: The images should be moveable i.e, ability to drag and drop the images around. The text entered should automatically wrap around the images. How could I accomplish this? I have looked at some jquery scripts and also looked through HTML5's canvas features, but am unable to find a solution. Thanks for your time. EDIT: This video shows the effect I wish

Store new position of RecyclerView items in SQLite after being dragged and dropped

佐手、 提交于 2019-12-18 11:36:17
问题 I have a two dimensional ArrayList of type String which is the input to the adapter class of the RecyclerView . The data in the list is taken from an SQLite database everytime when onResume() is called. I have implemented a drag and drop feature and an onMove() function that swaps the list elements successfully. However, I need to store the modified list before onResume() is called which will rewrite the list and fill it with old positions. My guess is to implement the rewriting functionality

How to handle drag/drop without violating MVVM principals?

浪尽此生 提交于 2019-12-18 10:58:45
问题 Currently I have in my XAML <TabControl AllowDrop="True" PreviewDragOver="DragOver" PreviewDrop="Drop" /> All of my drag/drop code exists within the codebehind of my View, rather than within my ViewModel. How can I handle drag/drop in my ViewModel without adding any dependencies on the View? 回答1: There are libraries for this such as gong and similar snippets on various blog articles. However, you shouldn't get too hung up on having absolutely no code-behind. For example, this is still MVVM in

Prevent drop of list item in JqueryUI sortable

自闭症网瘾萝莉.ら 提交于 2019-12-18 10:37:10
问题 I have two lists #sortable1 and #sortable 2 which are connected sortables, as shown in this example. You can drag and drop list items from sortable1 to sortable 2 . However, if an item in sortable 1 contains the class "number", I want to prevent the drop on Sortable2 and thus make the dragged item drop back into sortable 1 . I have used the following on sortable2: receive: function (event, ui) { if ($(ui.item).hasClass("number")) { $(ui.item).remove(); } but it deletes the list item from both

jQuery UI Sortable and two connected lists

霸气de小男生 提交于 2019-12-18 10:36:34
问题 I am trying to put together the following with jQuery and Sortable: There are two cases that I need to grab: A: move an item within the same list B: move an item from one list to another Case B is solved when only using the receive event. But if I bind both receive and stop they also get fired both when moving an item from one list to another. This makes it impossible for me to capture case A because I have no way of finding out if the item was moved from another list or within the same. Hope

How can I get jQuery UI's Draggable and Sortable functions to work on the iPhone?

随声附和 提交于 2019-12-18 10:24:40
问题 I have a page that uses JQuery UI; in particular the Sortable interaction. The page works fine for desktop web browsers with mice, however I can't get the drag-drop functionality to work on Mobile Safari on the iPhone. Any dragging action simply scrolls the page. The functionality on my page is extremely similar to the Sortable Empty-Lists demo on the JQuery UI site. This page also doesn't work on the iPhone. Is there any way to get the drag-drop functions working on the iPhone? 回答1:

Drag&Drop with Ember.js

♀尐吖头ヾ 提交于 2019-12-18 10:17:30
问题 Is there an example on how to implement Drag and Drop with Ember.js ? I have tried using jQuery UI, but the integration seems to be somewhat complex. I've seen this jsFiddle: http://jsfiddle.net/oskbor/Wu2cu/1/ but haven't been able to implement this successfully in my own app. What are the options for a rather simple drag&drop implementation using Ember.js ? 回答1: I took a look at the post by Remy Sharp and implemented a basic example in Ember.js, see http://jsfiddle.net/pangratz666/DYnNH/.