jquery-ui-droppable

Dragging rows between tables

早过忘川 提交于 2019-12-09 19:00:56
问题 The idea is pretty simple and it almost works. There are two tables and the user has the option of dragging rows between the two tables. When a row is dragged from table1 to table2, ajax is used in order to update the database with the data that is removed from table1, added to table2, and to re-display both of the tables with the new data. The same thing works if information is dragged from table2 to table1. You can see a sample of the code here. Here is an excerpt of the Javascript code for

Draggable adding spacing above elements

匆匆过客 提交于 2019-12-08 06:13:26
问题 The following is the code and my problem is that after you have dragged one element to the sortable area, the next element you add upon hovering over the sortable area it ads some kind of spacing top of the sortable area and i dont want this to happen. I cannot find it in my code. http://jsfiddle.net/j7xv4he4/ <meta charset="UTF-8"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js" ></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax

How do I link individual letters to a word? [closed]

随声附和 提交于 2019-12-07 16:06:34
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . I am creating a word game where you have to spell the words in the grid by dragging the letters in from the side. This code randomly generates 12 words from the "listOfWords" and dynamically creates a 6x6 table.

Disable drop if div has already been dropped?

独自空忆成欢 提交于 2019-12-07 08:24:24
I've created a drag and drop game in order to start teaching myself jquery. Everything seems to be working but you can drop more than one item onto the same square. I want to disable droppable if the place holder has an image in it. I've looked into: `greedy: true` That disables the drop but I'm not sure how to enable it again and also: $(this).droppable( 'disable' ); I can get these both to disable the drop but not sure how I get them to enable it again if the block/image reverts back to its original position or is moved to another square. Full version: http://creativelabel.co.uk/drag-and

Invalid mouse offset for cross-frame draggable + sortable

↘锁芯ラ 提交于 2019-12-07 07:23:50
问题 We are currently trying to accomplish cross-frame dragging between draggables and sortables provided by jQuery UI. This is working properly now. However, the mouse offset seems off when dragging from the parent to the child frame--please see this fiddle: http://jsfiddle.net/r5nfe/6/. Code in the parent: $('#my-frame').load(function () { $('.draggable').draggable({ appendTo: 'body', helper: 'clone', iframeFix: true, revert: 'invalid', connectToSortable: $('#my-frame').contents().find('

Draggable adding spacing above elements

荒凉一梦 提交于 2019-12-07 03:48:23
The following is the code and my problem is that after you have dragged one element to the sortable area, the next element you add upon hovering over the sortable area it ads some kind of spacing top of the sortable area and i dont want this to happen. I cannot find it in my code. http://jsfiddle.net/j7xv4he4/ <meta charset="UTF-8"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js" ></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script> <style> .wrapper { width: 700px; height: 500px; margin:

Dragging and Dropping onto a scaled element

坚强是说给别人听的谎言 提交于 2019-12-07 01:34:25
问题 I have a div element that I want to be able to drag onto a scaled element. However when I do this, the div element doesn't go to the right coordinates of the element but it does when I drag it around for the second time. I also think it scales up when the element get's added, which I want to try and avoid. Can anyone help me fix this? (especially the whole no going to the right spot thing) I've tried things like this to get the actual coordinates of the div but I'm not sure how to translate

Jquery draggable position - clone

拜拜、爱过 提交于 2019-12-06 16:16:24
问题 I have jquery draggable/droppable working with the containment and helper options set. What I'd like to do is to store the top and left parameters of the dropped item in two variables. I have achieved this in the following example (drag the new document icon into the box) however the position reported back is the position relative to the original icon instead of the parent DIV. Both the icon and the droppable box are absolute positioned. http://www.instructuk.com/drop.php Does anyone know how

JQuery Draggable + Droppable + Sortable

怎甘沉沦 提交于 2019-12-06 09:51:07
I'm sure this has been answered before but I can't find an example to fit my situation. I've got a list of images that are draggable. I've also got a div (id="dropZone") that is set to droppable and sortable. I'd like to fire a function when the images get dragged and dropped on the div, but not when things are dropped on the div from being sorted. Here's what I tried: stop: function() { $('#dropZone').prepend('<img src"img.png" />'); } This I added to the droppable images, however this will fire even when they are dropped outside the droppable. drop: function() { $('#dropZone').prepend('<img

How to swap 2 items using Draggable and Droppable?

孤街浪徒 提交于 2019-12-06 09:19:49
问题 Problem I have 4 images. User can drag and drop them to another list and change the order of the images. Target is that the users selects the order of the images. The problem is that I am unable to swap these images when they are place on each other. HTML <ul id="choices"> <li><img src="http://placehold.it/200x200&text=1" /></li> <li><img src="http://placehold.it/200x200&text=2" /></li> <li><img src="http://placehold.it/200x200&text=3" /></li> <li><img src="http://placehold.it/200x200&text=4"