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.

Filter by
Sorted by
Tagged with
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 ...
Tono Nam's user avatar
  • 35.2k
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 ...
Tony Xu's user avatar
  • 3,051
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 ...
Mahe's user avatar
  • 2,727
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 ...
user307635's user avatar
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 ...
Maxim Dsouza's user avatar
  • 1,557
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 ...
primavera133's user avatar
  • 1,294
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 ...
Cornelius's user avatar
  • 4,254
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 ...
Paolo Stefan's user avatar
  • 10.2k
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?
Jawahar BABU's user avatar
  • 1,085
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 ...
zsytssk's user avatar
  • 712
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 ...
rem's user avatar
  • 17k
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 ...
Yanb's user avatar
  • 680
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 ...
cdarwin's user avatar
  • 4,231
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 ...
Anurag P's user avatar
  • 357
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 ...
Andrew's user avatar
  • 233k
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" ...
Buda Gavril's user avatar
  • 21.5k
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 ...
Paul Peelen's user avatar
  • 10.2k
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 ...
craic.com's user avatar
  • 3,836
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 ...
bvitaliyg's user avatar
  • 3,195
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 ...
Srisa's user avatar
  • 1,007
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 ...
jackdbd's user avatar
  • 4,785
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 ...
Tim's user avatar
  • 361
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?
dharmendra's user avatar
  • 7,845
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 ...
user1861806's user avatar
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 ...
Grant's user avatar
  • 11.3k
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?
loris's user avatar
  • 213
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? ...
Rigil's user avatar
  • 549
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 ...
rayncorg's user avatar
  • 995
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 ...
Ji yong's user avatar
  • 433
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 ...
Zwiebel's user avatar
  • 1,615
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......
Jordan Davis's user avatar
  • 1,490
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 ...
julx's user avatar
  • 8,870
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, ...
Igor Ostancov's user avatar
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 ...
ptrus's user avatar
  • 141
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 ...
Mladen Janjetovic's user avatar
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-...
user654123's user avatar
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 ...
PruitIgoe's user avatar
  • 6,266
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 ...
Sheldon Pinkman's user avatar
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 ...
Shoni Fari's user avatar
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....
iwan's user avatar
  • 7,449
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 ...
Eli Perpinyal's user avatar
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 ...
Jan's user avatar
  • 5,778
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 ...
Agorilla's user avatar
  • 323
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....
Kayote's user avatar
  • 15.2k
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 ...
Nick Budden's user avatar
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 ...
Neenu Chandran's user avatar
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 ...
Manitoba's user avatar
  • 8,602
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 ...
karlitos's user avatar
  • 1,616
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 ...
Parad0x13's user avatar
  • 2,055
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?
Ricibald's user avatar
  • 9,659

1
2 3 4 5
43