drag-and-drop

Drag and Drop between 2 list boxes

萝らか妹 提交于 2019-12-30 07:22:11
问题 Trying to implement drag and drop between 2 listboxes and all examples I've seen so far don't really smell good. Can someone point me to or show me a good implementation? 回答1: Here's a sample form. Get started with a new WF project and drop two list boxes on the form. Make the code look like this: public partial class Form1 : Form { public Form1() { InitializeComponent(); listBox1.Items.AddRange(new object[] { "one", "two", "three" }); listBox1.MouseDown += new MouseEventHandler(listBox1

In Firefox and IE how can change the cursor while dragging over different targets?

泪湿孤枕 提交于 2019-12-30 05:53:11
问题 Doing drag and drop in HTML5, I need to be able to change the cursor depending upon the drop target. In Chrome this works by changing the dropEffect, if (e.currentTarget.id == 'dropMove') { e.originalEvent.dataTransfer.dropEffect = 'move'; } else { e.originalEvent.dataTransfer.dropEffect = 'link'; } however changing the dropEffect in IE and Firefox has no effect on the cursor. See the following Fiddle: http://jsfiddle.net/ksoncan34/s7kN5/ I've tried manually setting the cursor, with window

How to use JQuery to detect value-changed event when user drag & drop text into textbox?

≯℡__Kan透↙ 提交于 2019-12-30 05:25:25
问题 I'm using this jQuery code $('input').bind('change mouseup', ... ) to detect if user drag text somewhere into my input & change it value. But that seems doesn't work. Why doesn't it work and how I can get it to work? 回答1: var inputField = $("input"); var oldValue = inputField.text(); inputField.bind("drop", function() { //when the drop happens the input value will not be updated yet //use a timeout to allow the input value to change. setTimeout($.proxy(function() { if (this.value !== oldValue

Move items in a canvas using MVVM

柔情痞子 提交于 2019-12-30 05:18:06
问题 I want the user to be able to move items freely in a canvas. My app is using Caliburn.Micro. My MainViewModel has a collection if Items : public BindableCollection<ItemViewModel> Items { get; set; } That I display in a canvas through an ItemsControl : <ItemsControl x:Name="Items"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <Canvas Background="#FFCADEEF" /> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> <ItemsControl.ItemContainerStyle> <Style TargetType="ContentPresenter"> <Setter

D3js: Dragging a group by using one of it's children

懵懂的女人 提交于 2019-12-30 04:46:05
问题 Jsfiddle: http://jsfiddle.net/6NBy2/ Code: var in_editor_drag = d3.behavior.drag() .origin(function() { var g = this.parentNode; return {x: d3.transform(g.getAttribute("transform")).translate[0], y: d3.transform(g.getAttribute("transform")).translate[1]}; }) .on("drag", function(d,i) { g = this.parentNode; translate = d3.transform(g.getAttribute("transform")).translate; x = d3.event.dx + translate[0], y = d3.event.dy + translate[1]; d3.select(g).attr("transform", "translate(" + x + "," + y +

Swap elements when you drag one onto another using jQuery UI

冷暖自知 提交于 2019-12-30 04:43:08
问题 I have an arrangement of elements on a page: <div> <div class="dragdrop" style="top:0px; left: 0px; ">1</div> <div class="dragdrop" style="top:40px; left: 0px; ">2</div> <div class="dragdrop" style="top:60px; left: 0px; ">3</div> <div class="dragdrop" style="top:0px; left: 100px;">4</div> <div class="dragdrop" style="top:40px; left: 100px;">5</div> <div class="dragdrop" style="top:60px; left: 100px;">6</div> </div> How can I use jQuery UI (Draggable / Droppable) to make it so that if one div

Drag (move) a polygon using Google Maps v3

折月煮酒 提交于 2019-12-30 04:40:07
问题 The Google Maps API for a Polygon does not offer a drag method. What would be an efficient way of implementing such a feature (i.e., sufficiently optimised so that it would not kill a four year old laptop)? Thank you! 回答1: I found the Google Maps V2 Polygon Implementation to be very limiting for the needs I have had and solved it by creating a custom overlay. My group is currently stuck on IE6 so I have yet to migrate over to Google Maps V3 - but taking a quick look at the API shows that you

What are the best light-weight solutions for Drag and Drop?

拜拜、爱过 提交于 2019-12-30 03:29:05
问题 I love and use jQuery quite a lot, but I am hoping to find an alternate solution for a special project. I am creating a bookmarklet which will interface with my application to allow users to enter information much quicker. One of the greatest pains in my application at the moment is uploading images. Users (understandly) hate the process of downloading images to their computers in an organized fashion, and then uploading them to the app. What I would love the bookmarklet to do is load in a

Why is only 1 of 4 boxes droppable, if they are all supposed to be?

与世无争的帅哥 提交于 2019-12-29 09:02:22
问题 At my sandbox site, if you load it a drop down menu appears after a few seconds with "confirm" button. If you click that "confirm" button, the background image changes and some new boxes load. The four small boxes on the newly loaded page are draggable, and the 4 boxes inside the white box are supposed to be droppable, but only one is. New Update- Here is a working fiddle of the whole code . Click "submit" on the fiddle. After the new boxes load and they are all draggable and droppable.

WatiN FireEvent not passing event properties in FireFox

余生长醉 提交于 2019-12-29 08:15:27
问题 This had been logged as a bug in sourceforge though now deleted. I'm using FireFox 3.6 with associated jssh. I can see in Firebug that the Event Properties are not being set. I'm trying to drag and drop with code below var mouseDownEvent = new NameValueCollection {{"button", "1"}, {"clientX", "0"}, {"clientY", "0"}}; firstStoryRow.FireEventNoWait("onmousedown", mouseDownEvent); There are workarounds for passing these properties but not they're not nice. Does anyone know if this is an genuine