Questions tagged [drag]
In computer graphical user interfaces, drag is the first phase of a drag-and-drop operation. This involves selecting a virtual object by "grabbing" it and dragging it with the mouse down to a different location or onto another virtual object. An instance of some object relating to what was grabbed is usually brought with the drag operation.
2,146
questions
86
votes
9
answers
127k
views
How to use UIPanGestureRecognizer to move object? iPhone/iPad
There are several examples of the UIPanGestureRecognizer class. For example I have read this and I am still not able to use it...
On the nib file that I am working on I have a UIView (white rectangle ...
72
votes
7
answers
53k
views
How to mimic two-finger scroll/drag gesture on ios simulator?
I have a scroll page that I specified two fingers minimum. It works on my device, but don't know how to mimic this gesture on Simulator. I can mimic one-finger scroll without problem. I've tried ...
62
votes
7
answers
39k
views
Android Google Maps: disable dragging in MapFragment
Can I disable drag functionality when the user tries to drag the map with his fingers without disturbing the Zoom in and Zoom out?
Any one please suggest an idea of doing this!
Thanks for your ...
60
votes
8
answers
25k
views
Chrome sets cursor to text while dragging, why?
My application has many drag and drop features. While dragging I want the cursor to change to some grab cursor. Internet Explorer and Firefox work fine for this, but Chrome always changes the cursor ...
46
votes
4
answers
56k
views
Google Map Api v3 drag event on map
I am using google map v3 api. I need to detect the drag event on the map. Be it the drag on the map to move to a nearby geographical location or a drag on the marker. I need some javascript function ...
34
votes
2
answers
6k
views
Why is clientX reset to 0 on last drag-event and how to solve it?
I'm trying to drag elements along a line. They should push each other, not cross over or under.
To avoid having a shady element float around on drag, I drag a sub-div which then affects the position ...
33
votes
4
answers
10k
views
How to get notified of UITableViewCell move start and end?
I have a UITableView in my iOS app that gets refreshed periodically. The user is also able to move the tableview rows at all times (the tableview is always in editing mode).
I want to stop the ...
33
votes
4
answers
4k
views
How to make a pattern "fixed" in Raphael.js / IE?
I'm creating a small tool to illustrate the benefits of polarizing lenses. Basically a user will drag the lenses (a Raphael.js path) over a dazzling scene (the CSS background of the container DIV) and ...
31
votes
5
answers
31k
views
Cant drag and move a WPF Form
I design a WPF form with Window Style=None. So I Cannot see the drag bar in the form. How can I move the Form with WindowStyle=None Property?
30
votes
2
answers
43k
views
jquery html 5 dragstart .on('dragstart',function(e){}) e.dataTransfer.setData() doesn't work
chrome throw err: Cannot call method 'setData' of undefined,
I find the e is not equal to window.event(it havn't propert dataTransfer);both has very big different
I find both almost equal in the ...
26
votes
4
answers
35k
views
Click and drag selection box in WPF
Is it possible to implement mouse click and drag selection box in WPF. Should it be done through simply drawing a rectangle, calculating coordinates of its points and evaluating position of other ...
25
votes
8
answers
19k
views
How do I detect if a GestureDetector is hovered in Flutter?
So I have a widget GestureDetector in Flutter and I want it to do something on "hover", like this (dragged in any direction):
Is it possible to do it with GestureDetector? Any help ...
25
votes
1
answer
10k
views
Panning, exact definition
What is the difference between scrolling and panning?
Is panning identified as the action of dragging the image/background, while scrolling is only when you use scroll bars?
And, what is the ...
22
votes
1
answer
4k
views
Drag Event vs Mouse events for Drag and Drop
Recently I started to learn Drag and Drop API and was going through some tutorial on Youtube starting with this which was pretty good, Understood the whole Drag Cycle.
But I saw some other tutorials ...
21
votes
2
answers
11k
views
jQuery drag and draw
I'm trying to build a jQuery plugin that allows you to drag and draw a rectangle (or a div with a border) but I'm not sure how to do it. I don't know of any that currently have this ability so I don't ...
21
votes
6
answers
21k
views
android drag view smooth
I have to drag some views on screen. I am modifying their position by changing left and top of their layout parameters from motion event on ACTION_MOVE from touch listener. Is there a way to "drag" ...
21
votes
2
answers
2k
views
iOS drag on UIView, cloth effect
Since I saw this menu drag concept, I have really been interested to find out how to accomplish it.
So I am wondering how I would go about dragging with a cloth-effect in a UIView?
I know how to ...
20
votes
1
answer
17k
views
Dragging a Div in jQuery - fine when mouse is slow, but fails on fast mouse movement
I want to drag a div around using my own jQuery code.
This example on jsfiddle works fine when the mouse movements are slow
http://jsfiddle.net/craic/kr7Un/
But any fast movement pulls the mouse ...
20
votes
2
answers
25k
views
ViewDragHelper: how to use it?
In the Google IO 2013, Google has announced a new version of the Support Library, which includes ViewDragHelper class.
I saw the docs, but I couldn't find any sample of usage for this class.
For ...
20
votes
3
answers
46k
views
ios simulator: simulate swipe and drag
I have a UIView within a UIScrollView. When i want to simulate the drag event on the UIView, swipe event on the UIScrollView is being triggered.
As per the documentation , there isn't much of a ...
19
votes
2
answers
9k
views
How to mock DataTransfer with Jest
I have some React components where I use the HTML Drag interface.
In particular, I listen to dragover events on one component and set x and y positions with the DataTransfer object. Then, I listen to ...
18
votes
4
answers
23k
views
Creating OnDragListener for Google Map v2 Fragment
I’m trying to setup an onDrag Listener for a google map fragment, but can’t get the drag event to fire. Since the map doesn't support drag events directly, I'm trying to implement a drag listener for ...
17
votes
4
answers
43k
views
Touch and drag image in android
I am working on some example in which i want to drag the image corresponding to touch in Android. Does anybody have an idea about how I can do it?
17
votes
2
answers
6k
views
how to disable dragend animation in html5
I created a draggable element by setting its draggable attribute. When I drop the element, there is an animation of the element snapping back to its origin position:
How can the snap-back animation ...
16
votes
5
answers
13k
views
Drag a WPF Form around the desktop
i am trying to make a c# WPF form where i can drag it around the screen by clicking on it and moving with the mouse. the forms characteristics include being completely transparent and containing only ...
16
votes
8
answers
31k
views
How to drag a UserControl inside a Canvas
I have a Canvas in which user can add UserControl subclasses containing a form. User should be able to drag these UserControl around the Canvas.
What's the best practice to do this with WPF?
16
votes
5
answers
48k
views
Drag objects in canvas
Im looking for an easy to use method of assigning drag behavior to multiple objects (images, shapes etc) in canvas. Does anyone have a good way or know of any libraries for dragging objects around? ...
16
votes
1
answer
89k
views
Drag down formula and change ROW references instead of COLUMNS
In excel I have sheet1 contains total every month. (please see image below)
Then in my sheet2 it will display horizontally. (please see image below)
I used the formula =Sheet1!$B$1, my problem is ...
16
votes
3
answers
22k
views
Mouse click and drag Event WPF
I am developing an analog clock picker control.
The user is able to click on the minute or hour hand and drag to turn the needle to select the specific time. I was wondering how to detect such a ...
15
votes
2
answers
41k
views
Drag object in Unity 2D
I have looked for an object dragging script for Unity 2D. I have found a good method on the internet, but it seems it's just working in Unity 3D. It's not good for me as I'm making a 2D game and it's ...
15
votes
1
answer
4k
views
Drag & Drop - DataTransfer object
I'm building a simple drag n' drop uploader and I'm wondering why I can't see the file(s) I drop when I console.log(e) (DragEvent) and look at the DragEvent.dataTransfer.files it shows up empty, but......
15
votes
3
answers
40k
views
JavaScript Drag & Select functionality done right
I'm trying to write a drag & select functionality using HTML & JavaScript. By that I mean that there will be a set of objects with arbitrary absolute positions. I want to be able drag the ...
14
votes
7
answers
11k
views
DragMove() and Maximize
I have a problem with my custom window (AllowTransparency, WindowStyle=None) in WPF. DragMove() method works good, but when I maximize window, or it maximizing automatically by Windows 7 Aero Snap, ...
14
votes
1
answer
5k
views
drag and resize a shape in react-native
im new to react-native and overhelmed with all the options in the www. thats why i'm a bit confused how to complete this task in the best possible way.
i want to make something similar to this, but ...
13
votes
3
answers
65k
views
Swiper Touch Events - Enable click but disable drag
I am using Swiper 3.4.2 slider with thumbs as a pagination slider. And I need to disable drag on the pagination slider but to enable click events so the main slider can be changed by clicking on ...
13
votes
3
answers
8k
views
D3.js: Remove force.drag from a selection
I have a (rather simple) question: How to "un-call" force.drag on a selection made by D3.js? Let's say I created a set of elements and called "call" on it, giving it the drag-callback of a force-...
13
votes
2
answers
8k
views
Dragging the view
I have an NSView which I am adding as a sub-view of another NSView. I want to be able to drag the first NSView around the parent view. I have some code that is partially working but there's an issue ...
13
votes
2
answers
11k
views
javascript + html5 canvas: drawing instead of dragging/scrolling on mobile devices?
I'm using a html5 canvas + some javascript (onmousedown/move/up) to create simple draw pad on a webpage.
Works OK in Opera, Firefox, Chrome, etc (tried on desktop PCs). But if I visit this page with ...
13
votes
2
answers
2k
views
SwiftUI onDrag. How to provide multiple NSItemProviders?
In SwiftUI on MacOs, when implementing
onDrop(of supportedTypes: [String], isTargeted: Binding<Bool>?, perform action: @escaping ([NSItemProvider]) -> Bool) -> some View
we receive an ...
13
votes
3
answers
14k
views
JavaScript how to check drag direction
I am trying to monitor dragStart and dragEvent javascript, in order to conclude its direction, UP or DOWN.
However i could not get any detail in arguments passed by the event -- that help to conclude....
12
votes
2
answers
14k
views
How can i check if 2 controls overlap eachother on a canvas in WPF?
I am writing a designer that enables the user to drag controls around the screen.
What would be the best way of detecting if a control is overlapping another control while i am dragging the one ...
12
votes
4
answers
10k
views
Jquery ui, call start drag manually
In Jquery UI I can configure an element as draggable by invoking
$("#drag").draggable();
But is there a way to start and stop the drag functions manually from another function? Ie
someOtherFunction ...
11
votes
3
answers
25k
views
Handle click and drag movement to scroll horizontally with mootools or jquery
Is there an easy way to handle the movement event composed of click and drag to the left or to the right on a div, in order to do a classic slider.
The idea is to do something similar to the scrolling ...
11
votes
5
answers
25k
views
Simple drag and drop code
Im struggling with seemingly a simple javascript exercise, writing a vanilla drag and drop. I think Im making a mistake with my 'addeventlisteners', here is the code:
var ele = document....
11
votes
2
answers
4k
views
Resizing Handles on a Rotated Element
I'm trying to put resizing handles on the four corners of a rectangle, which can be dragged to resize the rectangle. What I'm having trouble with is calculating the new width, new height, and new ...
10
votes
4
answers
20k
views
angular/cdk simple drag not working for div with ngFor
I need to make an item draggable with angular-cdk. I have imported the DragDropModule in the app module. I am applying the cdkDrag inside an ngFor.
<div *ngIf="messages.length" >
<div
...
10
votes
1
answer
6k
views
Java - Scroll image by mouse dragging
I would like to make a join.me like in Java.
I've made the screen capture part but now I want to scroll in the image by dragging the mouse.
Here is a screen of what i've made:
First of all, I want ...
10
votes
2
answers
12k
views
How to set the Origin (drag.origin) for drag behavior in d3 JavaScript library
I am trying to implement drag behavior for group consisting from HTML-text and background-rectangle using the d3 framework. I was able to get it working, although when not setting the drag.origin I ...
10
votes
4
answers
25k
views
Dragging UIView under finger [duplicate]
I want to tap on a UIView and drag and have that view follow my finger, simple enough. But the easiest way of doing this is by setting the objects center to where the tap happened (Which is not what I ...
10
votes
2
answers
4k
views
Box2d: mousejoint without inertial delay
I'm using mousejoint to drag bodies in box2d, but it causes inertial delay.
Does it exist any way to drag a body instantaneously?