jquery-ui-draggable

Destroy JQuery draggable

梦想的初衷 提交于 2019-12-04 01:46:42
I have a set of elements that are draggable. How can I remove draggable function? $('.draggable').draggable('disable') is not an option in my case $('.draggable').draggable('destroy') returns Uncaught TypeError: Cannot read property 'options' of undefined From the jQuery UI API: destroy() Removes the draggable functionality completely. This will return the element back to its pre-init state. This method does not accept any arguments. Code examples: Invoke the destroy method: $( ".selector" ).draggable( "destroy" ); EDIT As this seems to not work properly for you - and it's an issue being seen

How can I detect a rightmouse button event on mousedown?

岁酱吖の 提交于 2019-12-03 19:50:13
问题 I am updating/debugging and expanding the capabilities of my draggable script and I need to be able to achieve the following result: whatever.onRightMouseButtonMousedown = preventDefault(); I have done a lot of research to no avail, however, I know that it is possible to do this because when I use jquery-ui draggable, it prevents the ability to drag elements when you mousedown with the right mouse button. I want to mimic this ability, and learn how it works so that I can implement it now and

Error jquery-ui draggable Cannot read property 'msie'

倖福魔咒の 提交于 2019-12-03 18:01:32
问题 I got some troubles to make work jquery-ui draggable . I will share with you my solution, this is the best solution? I just insert this to test before I start my real work. <script src="http://code.jquery.com/jquery-latest.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.24/jquery-ui.min.js"></script> and $('img').draggable(); Like here: http://jsbin.com/eqowet/2/ But I got a error: Error: Uncaught TypeError: Cannot read property 'msie' of undefined. 回答1: msie is

JQuery UI draggable: Exceed containment on one side

爱⌒轻易说出口 提交于 2019-12-03 14:40:16
I am using JQuery UI to implement resizable/draggable elements. Now I would like to define a containment for these elements that limits the resizing/dragging on exactly three(!) sides. E.g. have a look at this JSFiddle example . You can see that the contained element can only be resized/dragged inside the parent's area. What I would like to achieve is that the element can exceed the bottom threshold and be moved to beyond the bottom border of the parent. Nevertheless the resizing/dragging should still be limited at the top, right and left sides as is prescribed by the parent's according

Getting jQuery sortable, droppable and draggable to work together

穿精又带淫゛_ 提交于 2019-12-03 14:32:56
I am trying to use jQuery sortable, droppable and draggable to work together. I have 3 lists: a break-point placeholder; report rows; report groups. The user should be able to: Drag as many placeholder copies into the 'report rows' list Drag one-at-a-time a single 'report group' (not a clone) into the 'report rows' collection (but not vice-verse)...until no more report groups are left. The user should be able to sort the report rows list ad nauseum. My problem is... I cannot get Number 2 above to work Side Note: I really did try to create a jsFiddle for this but couldn't get jsFiddle to

Disabling jQuery drag when scrolling contents of draggable item

℡╲_俬逩灬. 提交于 2019-12-03 08:11:38
I don't normally make this sort of question / answer, but figured I'd do so, since I've seen this question asked 20+ times, and not a single answer actually works. In short, the problem is that if you have scrollable content ( overflow: auto; anywhere inside of a draggable jQuery item, when you click and drag the scrollbar's the parent draggable container drags along with it. So, I spent some time working up a solution. Here's an example of some html that would present this problem: <div class="draggable" style="width:100px;height:100px;"> <div id="content" style="width:80px;height:80px

jQuery droppable - receiving events during drag over (not just on initial drag over)

岁酱吖の 提交于 2019-12-03 03:42:08
问题 I am using jQuery droppable (in conjunction with jQuery draggable) to allow the user to add rows to an HTML table by dragging items from a list and dropping them on the table. This works well, however at present the logic is that when the user drag-drops on a table row the new row gets added below the row they dropped on. It would be better if the new row's add position was based on whether the user dropped in the upper or lower half of an existing row. This is easy enough to calculate in the

jQuery UI Draggable/Sortable - Dynamically added items not draggable

送分小仙女□ 提交于 2019-12-03 03:33:01
I have a Draggable/Sortable set of lists that I am dynamically adding items to, but the trouble is, that once an item has been added, it's not possible to move them to the new lists. You can see the functionality here: http://jsfiddle.net/Y4T32/2/ Drag an item from the available list to one of the target lists, and you'll see that I mean. Now add a "callout" and try to drag the new item to one of the target columns. I found another answer on here that works as I want, but have been unable to reproduce the results they got (and of course, can't find the answer now). Any insight into what I am

How to fix wrongly positioned draggable helpers for connected sortables (partially caused by floated/relative positioned parent elements)?

时光怂恿深爱的人放手 提交于 2019-12-03 01:37:51
Preface I'm experiencing a problem where the draggable helper is being offset incorrectly, when using draggables + sortables that are placed in floating, relative positioned parent elements. The floated parent elements are Bootstrap columns, where multiple sortable lists are placed in one column, and a list of draggables is placed in another. Example Here's a working example snippet $('.sortable').sortable({ connectWith: '.sortable', revert: 600, forcePlaceholderSize: true, placeholder: 'ui-sortable-placeholder', tolerance: 'pointer' }).disableSelection(); $('.draggable').draggable({

How to use the jquery ui draggable method on an canvas object?

好久不见. 提交于 2019-12-02 17:02:13
问题 I'm trying to allow the user the ability to move a rectangle around a canvas element using the draggable method. This was my original thought but it doesn't work. I have a fiddle set up at http://jsfiddle.net/r2Zbe/ $("button").click(function () { var door = bgContext.strokeRect(20, 20, 50, 150); door.draggable(); }); 回答1: Not sure about using jQuery UI with canvas, but if you are working with canvas you may want to take a look at EaselJS. It makes everything, including drag and drop, very