drag

How to get the id of the dragged element in javascript?

╄→гoц情女王★ 提交于 2019-12-13 16:41:38
问题 I want to get the id of the dragged element in javascript in the drop event handler. div with id place5 is draggable with drop location being another div with id dropArea. In the drop event handler how to get the id of div(place5)? <html> <head> <style> .mainArea{ width: 500px; height : 500px; border-color:red; border-style:solid; border-width:5px; } </style> <script> function dragEventHandler(theEvent) { theEvent.dataTransfer.setData("Text", theEvent.target.id); //Some code here. } function

NullPointerException org.chromium.android_webview.AwContents$AwViewMethodsImpl.onDragEvent

久未见 提交于 2019-12-13 15:41:41
问题 about 10 days ago, my app started to record this exception (seen on dev console): java.lang.NullPointerException: at org.chromium.android_webview.AwContents$AwViewMethodsImpl.onDragEvent (AwContents.java:191) at com.android.webview.chromium.WebViewChromium.onDragEvent (WebViewChromium.java:782) at android.webkit.WebView.onDragEvent (WebView.java:2554) at android.view.View.dispatchDragEvent (View.java:22202) at android.view.ViewGroup.dispatchDragEvent (ViewGroup.java:1431) at android.view

Preventing execution pause when dragging game window

浪子不回头ぞ 提交于 2019-12-13 14:26:24
问题 I have a server and a client. But when ever I start moving the game window, it stops executing code until the window stops moving,causing a connection timed out because the server or client stopped responding for a while. What do I need to do in order to make the game always run code, even when the game window is being moved? 回答1: This is a known issue with XNA games, and there are several ways around it. One way is to move a fake window frame, which isn't the game window really. Game window

jQuery dragging divs selected text

北城以北 提交于 2019-12-13 12:42:21
问题 I'm using jquery to make a few divs draggable on a website. My code is similar to this: $("#thediv").bind('mousedown',function(){ $(document).bind('mousemove',function(ms){ //drag }) }); The problem is that if the mouse is too fast for the div, the mouse goes outside of the div. This selects random content on the screen (highlights it blue). It does not give a smooth drag effect. Is there a nice way of fixing this? jQuery's ui drag plugin does not have this problem. I don't want to use it

Usercontrol drag & drop on Panel

℡╲_俬逩灬. 提交于 2019-12-13 08:58:22
问题 I'm making a graphical editor, but I am experiencing some problems with the drag & drop over a Panel . The Ellipse doesn't take the exact position where I drop it, and I think it's placed in a UserControl of size 150;150. Here's a link of a short movie to illustrate what I mean: http://gyazo.com/abf5484a31e2d1ce8ebccc49bee9fdb6 In the first part you can see that the Ellipse goes to the wrong position and in the end of the movie when I draw a line it seems that the ellipse has a block around

HTML5 Video: Detect dragging of timeline

白昼怎懂夜的黑 提交于 2019-12-13 06:51:34
问题 I was wondering if there is a full-proof way of knowing when the user is dragging the timeline of an HTML5 video. Thus far I've been binding to timeUpdate, but it's unclear whether the currentTime is increasing due to a drag or simply the video playing. Thanks! 回答1: I know that MediaElement.js which is a html5 video element implementation supports an event called 'seeked' which gives you what you want. You could use that or look into the code to see what kind of logic they're using for

d3.event.y has strange values during drag behavior

寵の児 提交于 2019-12-12 14:32:13
问题 I'm creating an example illustrating a layout with resizeable cells using the D3 drag behaviour and CSS {display: table} styles. It works fine for dragging horizontally, but not vertically. For vertical resizing, d3.event.y is providing values that do not make sense to me. Here is a fiddle showing the working horizontal drag and the broken vertical drag. Take a look at the console output while dragging to see that the values returned by d3.event match the values returned by d3.mouse() for the

Reordering items in a QTreeWidget with Drag and Drop in PyQt

梦想与她 提交于 2019-12-12 10:08:41
问题 I have a QTreeWidget with what I thought all the proper settings setup in order to be able to reorder items by dragging them around. It can work, at times, but more often than not I drag an item into another one and it either disappears or becomes a child. Is there anyway to prevent this from happening so you don't lose items you're trying to reorder? I figured you could achieve this within Qt Designer. I have dragDrop mode set to InternalMove and defaultDropAction set to MoveAction, but I'm

Mouse click and drag Event WPF

馋奶兔 提交于 2019-12-12 09:33:21
问题 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 click and drag event. I tried using MouseLeftButtonDown + MouseMove but I cannot get it to work as MouseMove is always trigger when the mousemove happen despite me using a flag. Is there any easier way? public bool dragAction = false; private void minuteHand_MouseLeftButtonDown(object sender,

Control that simulates dragging of the window title bar

强颜欢笑 提交于 2019-12-12 08:06:00
问题 I've built a custom control, and I'd like to allow people to click and drag on my control just as if they were dragging on the window title bar. What is the best way to do this? So far I've been unsuccessful at leveraging the mouse down, up, and move events to decipher when the window needs to be moved. 回答1: In addition to my other answer, you can do this manually in a Control like this: Point dragOffset; protected override void OnMouseDown(MouseEventArgs e) { base.OnMouseDown(e); if (e