Drag-Drop elements between parent frame and child iframe

AFAIK, if iframes come from different domains, this is not doable in a “common” way (unless you control both iframes), browser security measures prevent it, otherwise you could wrap a banking website and steal passwords, for example, when you log in. Some info on workarounds: http://softwareas.com/cross-domain-communication-with-iframes If you control both iframes: Drag & Drop between … Read more

How to exclude an element from being dragged in sortable list?

You need to use cancel. See working example here. Js: $(function() { $(‘.sortable’).sortable(); $(‘.sortable’).disableSelection(); $(‘.sortable’).sortable({ cancel: ‘.note’ }); });​ As @Zephyr points out, this let’s you re-arrange the position by dragging the siblings, if you want to avoid that, use owise1 approach: $(‘.sortable’).sortable({ items : ‘:not(.note)’ });

Draggable revert if outside this div and inside of other draggables (using both invalid and valid revert options)

Your thinking was correct, you have to make the small boxes greedy droppables and handle the drop event on them. The tricky part is to cancel the drag operation. By default, your draggables should start as revert:’invalid’. You don’t have to do anything if they are dragged inside the big box, which in my example … Read more

Restrict jQuery draggable items from overlapping/colliding with sibling elements

Edit: New Solution I found a plugin for this called JQuery UI Draggable Collision. Using this, implementing your desired functionality becomes trivial. See the following jsFiddle example: http://jsfiddle.net/q3x8w03y/1/ (This uses version 1.0.2 of JQuery UI Draggable Collision, along with JQuery 1.7.2 and JQueryUI 1.1.18.) Here is the code: $(“#dragMe”).draggable({ obstacle: “#butNotHere”, preventCollision: true, containment: “#moveInHere” … Read more

When I make a draggable clone and drop it in a droppable I cannot drag it again

One way to do it is: $(document).ready(function() { $(“#container”).droppable({ accept: ‘.product’, drop: function(event, ui) { $(this).append($(“ui.draggable”).clone()); $(“#container .product”).addClass(“item”); $(“.item”).removeClass(“ui-draggable product”); $(“.item”).draggable({ containment: ‘parent’, grid: [150,150] }); } }); $(“.product”).draggable({ helper: ‘clone’ }); }); But I’m not sure if it is nice and clean coding.

grouping draggable objects with jquery-ui draggable

You could use the draggable’s helper option to drag groups of items. For example, if your draggables have checkboxes, you can return the selected items from the helper function like so: $(‘#dragSource li’).draggable({ helper: function(){ var selected = $(‘#dragSource input:checked’).parents(‘li’); if (selected.length === 0) { selected = $(this); } var container = $(‘<div/>’).attr(‘id’, ‘draggingContainer’); container.append(selected.clone()); … Read more

jQuery draggable shows helper in wrong place after page scrolled

This might be a related bug report, it’s been around for quite a while: http://bugs.jqueryui.com/ticket/3740 It seems to happen on every browser I tested (Chrome, FF4, IE9). There are a few ways you can work around this issue: 1. Use position:absolute; in your css. Absolutely positioned elements don’t seem to be affected. 2. Make sure … Read more