jquery-ui-draggable

jQueryUI manipulate draggable clone

淺唱寂寞╮ 提交于 2019-12-08 02:39:57
问题 EDIT: I Trimmed this question down, and put it on See how it's the original and not the new item that gets altered http://jsfiddle.net/mikkelbreum/DBG5q See how the dragged helper gets altered, but the element reverts back once it's dropped. http://jsfiddle.net/mikkelbreum/dpTC8 I've got a draggable list linked to a sortable list When I drag from draggable to sortable I use a cloned helper, so the original is still left in draggable collection. each time I drag a clone from the draggable list

Draggable/Droppable for Battleship game

你。 提交于 2019-12-07 18:55:45
I've been experimenting with the jQuery UI draggable/droppable interaction to allow a user to set ships for a game of Battleship. As far as I can tell, droppable interactions work just fine when the drop location is appropriately sized to fit a draggable item, but in the Battleship game, you have ships of several different lengths that fit into a number of squares ranging 2-5. If you check out this jsFiddle ( http://jsfiddle.net/cDqGN/ ), and mess around with the ship of length two (versus the single block), you'll see it's fairly easy to screw up the drop, with the ship getting stuck between

jquery-ui 1.9.1 ui-draggable not working with ie9 and ie10

核能气质少年 提交于 2019-12-07 17:47:19
问题 I am having trouble making .draggable work in IE 9 and 10. The main javascript packages used are: jquery-ui-1.9.1.min.js and jquery-1.8.2.min.js The code basically looks like this: creation.texts.resize = function(){ jQuery('.modification-text.active .creation-resize-handler').draggable({ start: function(event, ui){ ... some code ... }, drag: function(event, ui){ ... lots of code ... }, stop: function(event, ui){ ... some code ... creation.texts.resize(); } }); } It works perfectly fine with

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.

draw line with jquery between two divs

前提是你 提交于 2019-12-07 11:14:54
问题 how can I draw line between two div's with jquery library or simple javascript? I have various div's boxes on page with there id's id1 #id2 #id3 #id4 and #id5 and so on... what I wants if I click on #div1 and drag it to #div2 It will make an arrow line between #div1 and #div2 pointing to 2, And somehow save this connection details. Also i can attach #div1 to other div's and it save that connection details as well. (I am using jquery UI if that matters). Thanks for any help. 回答1: i found http:

Reposition element prior to dragging with jQuery UI

孤街浪徒 提交于 2019-12-07 08:42:51
问题 This is an attempt to solve the problem of drag elements aligning to a grid (I outlined this in a previous question- Getting jQuery draggable to snap to specific grid) So far I've established that the issue is that jQuery calculates the position of the element at the moment that .draggable() is called, and creates the grid relative to the element, instead of relative to the element's parent (which would be more intuitive). In the following solution, we see 3 boxes: Box 1 starts out at 0,0,

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

Jquery Draggable with more than one handle

情到浓时终转凉″ 提交于 2019-12-07 05:42:25
问题 Is it possible to have a draggable element with more than one handle? I am initializing it twice, each time with a different handle param, but it doesn't work - only the first one works. 回答1: You should only pass the 'handle' param once, and it can either be a selector or an elements(/s). So, to make it work with more than one handle: $(elem).draggable({ handle: '#handle1, #handle2', }); More info / source: http://docs.jquery.com/UI/Draggables/draggable 回答2: Sure. Just have these handlers

jQuery Draggable drags off screen

我怕爱的太早我们不能终老 提交于 2019-12-07 02:03:04
问题 When the user grabs the titlebar of a window and drags to the right all the way, the page will start to scroll right. Is there anyway to prevent this? To reproduce: https://jqueryui.com/draggable/ Drag the window to the right. I have overflow: hidden on the html and body tags. Not sure what else to do here. I'd prefer not to use the containment option on the window because I want them to be able to slide off screen slightly. 回答1: When you use jQuery UI Draggable, you have an option called

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