draggable

iPhone SDK:Trouble Dragging a UIImageView

孤人 提交于 2019-12-06 02:15:20
问题 I am trying to drag a UIImageView around the iphone screen in my app. Currently The drag functionality I have set up is fine and dragging the image does move it around the screen, the trouble is that you don't have to drag the image view to move it, you can also drag anywhere on the screen and it will move the image. I am new to this platform so I can't really think about what to do to solve this issue. My current code to drag the image is: - (void) touchesBegan:(NSSet*)touches withEvent:

How to make a user control draggable on screen like a window

限于喜欢 提交于 2019-12-06 01:50:09
问题 My WPF application has a UserControl which is supposed to look and behave like a popup window, but it isn't a window. The reason the control doesn't descend from the Window class is because it contains a third-party virtual on-screen keyboard, and that control has to be in the same window as the TextBox controls that it sends input characters to when you click on its buttons. If the keyboard control is not in the same window, it can't even see the TextBox controls. The problem I'm having is

Jquery UI combine sortable and draggable

♀尐吖头ヾ 提交于 2019-12-05 22:41:28
问题 I'm trying to combine a draggable panel (on top), and a sortable panel (bottom). Dragging works fine, but sorting fails. Here is my JS fiddle: http://jsfiddle.net/dmUKY/9/ Both drag'n drop and sortable functions shares the droppable:drop function. When sorting elements, the function has to replace the selected object. drop: function (event, ui) { //alert($(this).parent().html()); //alert($(ui.helper).attr('class')); var obj; if ($(ui.helper).hasClass('draggable')) { //alert('draggable'); obj

Highlighting table cells for a single row on mouse drag

别来无恙 提交于 2019-12-05 18:21:37
What I am trying to do is allow the user to highlight cells in a table when they drag the mouse over them, very much as outlined in the question and answer Select Cells On A Table By Dragging What I need to do though is restrict the drag / highlight effect from spanning more than one column. e.g. which ever column the user start the drag event in they cant highlight out side that column. Anyone have any ideas on how to achieve this? Taking the example that is in the other question, you should give the "td" element an attribute, like data-row and data-col, then when somebody is selecting store

How to make dynamically added list elements draggable in jquery?

核能气质少年 提交于 2019-12-05 15:45:38
Here is my code from http://jsfiddle.net/XUFUQ/1/ $(document).ready(function() { addElements(); } ); function addElements() { $("#list1").empty().append( "<li id='item1' class='list1Items'>Item 1</li>"+ "<li id='item2' class='list1Items'>Item 2</li>"+ "<li id='item3' class='list1Items'>Item 3</li>" ); } $(function() { // there's the gallery and the trash var $gallery = $( "#list1" ), $trash = $( "#list2" ); // let the gallery items be draggable $( "li", $gallery ).draggable({ cancel: "button", // these elements won't initiate dragging revert: "invalid", // when not dropped, the item will

Control draggable movement in jQuery

萝らか妹 提交于 2019-12-05 15:17:58
how can I control de movement of a draggable in jquery? I need to do something similar to the "snap to grid" where the draggable moves every "x" and "y" pixels I can't use "grid: [x, y]" (2D) because I need to make the drag on an isometric grid (3D) (I will develop the grid later, I first need to controll the drag) for example: when I start the dragging, the draggable shouldn't move, it has to snap to another position when the "x" and "y" are under certain conditions thanks in advance! Try using the options inherent in the .draggable() function at http://jqueryui.com/demos/draggable/ basically

Drag and Drop in nested dataTables

你说的曾经没有我的故事 提交于 2019-12-05 13:07:41
I am using primeface 4.0. The primeface showcase only shows how to drag a draggable in to a droppable . But then how to drag a that draggable out of that droppable is never mentioned. I wantto make a dataTable that: Each td cantains a droppable panel which multiple draggable can be both draged in to and out of . A back bean object that "keeps data" of this dataTable, which I assume if the dataTable is 2*2, there will be 4 List in the back bean, each stores a list of draggable objects of corresponding droppable area. Kinda like a simpler version of p:schedule that allows events to be drag and

QGraphicsItem move event - get absolute position

一世执手 提交于 2019-12-05 09:42:10
I have a QGraphicsEllipseItem that I want to be movable and triggering signals on moving. So I subclassed QGraphicsEllipseItem and QObject and overrode the itemChange method to trigger a signal. That all seems to work but the positions that are reported seem to be relative to the old position of the item. Even if asking the item for its position seems only to retrieve the relative coordinates. Here is some code to make clear what I have done: class MyGraphicsEllipseItem: public QObject, public QGraphicsEllipseItem { Q_OBJECT public: MyGraphicsEllipseItem(qreal x, qreal y, qreal w, qreal h,

jQuery UI draggable element dropped into sortable

三世轮回 提交于 2019-12-05 08:17:45
I have a list of draggable items, and I wish to be able to drag them onto a sortable content block. Here’s my markup: <div class='items'> <div class="one">One</div> <div class="two">Two</div> </div> <div class="content"> <div class="block">Foo</div> <div class="block">Bar</div> </div> The thing is, that I want the dragged item to "become" a block as soon as the dragging starts and remain a block when it’s dropped. I have tried this: $('.items div').draggable({ helper: function(e) { return $('<div>').addClass('block').text( $(e.target).text() ); }, connectToSortable: ".content" }); $('.content'

is there a way to make divs not overlap eachother while dragging via jquery draggable [or etc..]?

怎甘沉沦 提交于 2019-12-05 06:12:21
is there a way to make divs not overlap eachother while dragging via jquery draggable()? i have a bunch of divs that user can drag around but i can not have them overlap eachother. basically i'm creating a canvas where user can freely move the site's contents around the site but it needs to not overlap the other content while moving them. any ideas? You can try jquery-collision plus jquery-ui-draggable-collision . Full disclosure: I just wrote and released these on sourceforge. The first allows this: var hit_list = $("#collider").collision(".obstacle"); which is the list of all ".obstacle"