draggable

Is it possible to have a Jquery Draggable object under an other div

南笙酒味 提交于 2019-12-06 07:36:59
I'm attempting to create a template system where an uploaded jpg is then placed on a template. Test example: http://www.silverink.com/TEMP/jqueryTest/ The problem is that I want to have a mask on the top most layer but be able to click and drag the lower layer. At present I'm having to either click the area to bring it to the fore then drag or have it at the fore transparent. Any ideas or suggestions most welcome!! There is actually an easy way: create the draggable as usual for the occluded element, and add a mousedown event handler on the occluding image to delegate the event to the

Implementing Drag n Drop using JQuery

こ雲淡風輕ζ 提交于 2019-12-06 07:36:04
I am developing a MVC application wherein I have to implement Drag n Drop functionality. I also want to get the source as well as target items/ records in the table/ div once the item is dropped on a target place. Then both the source and target values will be passed to the action method defined in the controller to update the same in the database. Can anyone please suggest some links? Use http://api.jquery.com/serialize/ to pass your data and jQuery UI sortables http://jqueryui.com/demos/sortable/ for the drag and drop. 来源: https://stackoverflow.com/questions/7147873/implementing-drag-n-drop

Easy UI 入门

你。 提交于 2019-12-06 06:59:39
Easy UI常用于企业级开发的UI和后台开发的UI,比较重。 1.Draggable(拖动)组件 不依赖其他组件 1.1加载方式 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <link rel="stylesheet" type="text/css" href="easyui/themes/default/easyui.css"> <link rel="stylesheet" type="text/css" href="easyui/themes/icon.css"> <script type="text/javascript" src="easyui/jquery.min.js"></script> <script type="text/javascript" src="JS/Demo.JS"></script> <script type="text/javascript" src="easyui/jquery.easyui.min.js"></script> </head> <body> <div id="box" style="width :400px;height: 200px;background:orange;" > 内容部分 </div>

Remembering a jQuery draggable tool palette position between page refreshes

試著忘記壹切 提交于 2019-12-06 05:49:26
I have a tool palette which shows up when an admin user is logged in to a site. The palette is draggable (via jQueryUI.draggable) and I would like it to remember the position between pages/refreshes... Is there a standard way of doing this, or a plug-in I should be using, or do I need to roll my own (via cookies or something)? Alex Gyoshev Cookies are a fine option - you can use the functions by PPK like this: $('#palette') .css({ top: readCookie("palletteY")*1, left: readCookie("palletteX")*1 }) .draggable({ stop: function (event, ui) { createCookie("palletteX", ui.position.left, 100);

Vue.Draggable: How to “drag an item onto another item” instead of adding/removing

不打扰是莪最后的温柔 提交于 2019-12-06 05:36:59
问题 Using https://github.com/SortableJS/Vue.Draggable I have a question on how to achieve the classic example of dragging a file into a folder. I see the @change event gets data about the dragged item, but not about the item that its being dragged onto. Any ideas on how to achieve this? Here's an example of what it would look like more or less, but obviously I would like to be able to reassign the file.folder_name inside that onFoldersChange - somehow. https://jsfiddle.net/u5nb48cs/2/ Thanks! 回答1

Firefox: dragstart event doesn’t fire in hyperlink’s children

时间秒杀一切 提交于 2019-12-06 04:47:23
There is a problem handling a draggable element which is a child of a hyperlink ( a href ). Here is HTML: <a href="#" id="a">Some text <span id="span" draggable="true">and some more text</span> </a> I try to catch dragstart events for both elements in JS: var a = document.getElementById('a'); a.addEventListener('dragstart', function() { console.log('Dragging a link…'); }); var span = document.getElementById('span'); span.addEventListener('dragstart', function() { console.log('Dragging a span…'); }); In Firefox (28.0, Windows 8 and Ubuntu 13.10), if I try to drag the span, only the first

Draggable toolbar

假装没事ソ 提交于 2019-12-06 04:33:41
how to make draggable/dockable toolbar with JFace/SWT like Eclipse has? Could you post a simple example of ApplicationWindow or link good source of how to make it. Thanks. SWT has a component called CoolBar, You can create CoolBars fairly easily by using CoolBarManager , or you can manually use just them ( API Doc ) In case that someone found this question I have prepared small example. My problem was in incorrect use of add method. You have to use add(IToolBarManager toolBarManager) method from CoolBarManager not one of from base class ContributionManager . import org.eclipse.jface.action

Can you tell if one element is touching another using JavaScript?

非 Y 不嫁゛ 提交于 2019-12-06 04:16:14
问题 I want to use JavaScript to check if one div element (that can be dragged) is touching another div element. Here is some code: <div id="draggable" style="position: absolute; top: 100px; left: 200px; background-color: red; width: 100px; height: 100px;"></div> <div style="background-color: green; width: 100px; height: 100px;"></div> Can this be done? If so, how? Edit: I do not want to use jQuery, just plain old JavaScript! 回答1: A more complete solution Below is a "plain old JavaScript" rewrite

jquery dialog: dragging dialog with iframe inside

蓝咒 提交于 2019-12-06 04:08:02
问题 When dragging a jquery dialog with an iframe inside , the drag stops if the mouse goes over the frame contents while dragging. It seems that the iframe takes automatically the focus. is there any way to prevent this and make drag normal? var iframe=document.createElement('IFRAME'); $(div).append(iframe) .dialog(); 回答1: It's just my guess, but I'd try covering everything with a transparent div 100% width&height while dragging and assuring it's above iframes and under the dragged thingie :) 回答2

Draggable CALayer

此生再无相见时 提交于 2019-12-06 03:28:46
Any way of making a CALayer draggable by the user? If so, how? (In Cocoa - Mac) Layers can not receive mouse events themselves. You would have to do the event handling in the view or view controller containing the layer. If a mouseDragged: event originates on a layer (see -[CALayer hitTest:] and -[CALayer containsPoint:] to test this), adjust the layer's position accordingly. You will probably want to disable implicit animations to have the layer follow the mouse pointer immediately (rather than lagging a little behind because of the animation of the position property): [CATransaction begin];