draggable

vue项目中实现对数组的拖拽排序功能

天涯浪子 提交于 2020-01-13 05:48:19
Vue项目中实现对数组的拖拽排序功能 下载插件 npm install vuedraggable - S 下载以后,在vue文件的script标签里面引入 import draggable from 'vuedraggable' 注册组件,并把一些options中的参数写进数组 export default { name : 'draglist' , data ( ) { return { dragOptions : { animation : 120 , scroll : true , group : 'sortlist' , ghostClass : 'ghost-style' } , doing : [ { id : 1 , content : '开发登录注册页面' } , { id : 2 , content : '开发头部组件' } , { id : 3 , content : '开发表格相关组件' } , { id : 4 , content : '开发表单相关组件' } ] , template标签部分代码 注:draggable标签中的v-model写的是要执行拖拽的数组对象 < div class = "drag-box-item" > < div class = "item-title" > doing < / div > < draggable v -

C# Drag & Drop Multiple Images within Canvas

断了今生、忘了曾经 提交于 2020-01-12 09:40:39
问题 I've got the following code to drag and drop images inside my Canvas: img.AllowDrop = true; img.PreviewMouseLeftButtonDown += this.MouseLeftButtonDown; img.PreviewMouseMove += this.MouseMove; img.PreviewMouseLeftButtonUp += this.PreviewMouseLeftButtonUp; private object movingObject; private double firstXPos, firstYPos; private void MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { // In this event, we get the current mouse position on the control to use it in the MouseMove event.

C# Drag & Drop Multiple Images within Canvas

懵懂的女人 提交于 2020-01-12 09:37:59
问题 I've got the following code to drag and drop images inside my Canvas: img.AllowDrop = true; img.PreviewMouseLeftButtonDown += this.MouseLeftButtonDown; img.PreviewMouseMove += this.MouseMove; img.PreviewMouseLeftButtonUp += this.PreviewMouseLeftButtonUp; private object movingObject; private double firstXPos, firstYPos; private void MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { // In this event, we get the current mouse position on the control to use it in the MouseMove event.

jQuery UI draggable to smaller droppable

无人久伴 提交于 2020-01-11 06:11:34
问题 I am using this http://jqueryui.com/demos/droppable/ But I have a problem dragging to a droppable that is smaller than the draggable. It will not drop on the droppable, but on the top left of the droppable. (source: yart.com.au) Is there any way around this? Here is the code, thanks. $('.draggable').draggable({ revert: 'invalid', revertDuration: 500, appendTo: 'body', helper: function(event, ui) { return $(this).clone().appendTo('body').css('zIndex', 5).show(); }, drag: function(event, ui) {

Constrain jquery draggable to stay only on the path of a circle

こ雲淡風輕ζ 提交于 2020-01-10 04:15:06
问题 So Im trying to make something where the user is able to drag planets along their orbits and it will continuously update the other planets. Ideally I would like this to work with ellipses too. So far I can drag an image node with jquery and check/change the coordinates, but i cannot update the position reliably while the user is dragging the object. I know there is an axis and a rectangle containment for draggable but this doesn't really help me. I have a site for calculating planetary orbits

JQuery UI Draggable - Helper function which returns clone() only clones once if arguments passed to clone()

▼魔方 西西 提交于 2020-01-07 05:40:49
问题 I am cloning elements as they are dragged out of a JQuery UI Draggable list using JQuery's clone() method. Looking at the clone() documentation, I see that I can clone events already bound to these elements by passing one or two Boolean arguments (true,true) to the clone() method. It's with passing these arguments that things get weird. If I just use clone() as shown below, things work as expected. $(".draggable").draggable({ connectToSortable: ".sortable", helper: function(e) { return $(this

Uncaught TypeError: Cannot use 'in' operator to search for 'position' in undefined

爷,独闯天下 提交于 2020-01-06 20:09:52
问题 I've got a problem with this code snippet: <script> $.sap.require('sap.ui.thirdparty.jqueryui.jquery-ui-core'); $.sap.require('sap.ui.thirdparty.jqueryui.jquery-ui-widget'); $.sap.require('sap.ui.thirdparty.jqueryui.jquery-ui-mouse'); $.sap.require('sap.ui.thirdparty.jqueryui.jquery-ui-draggable'); $.sap.require('sap.ui.thirdparty.jqueryui.jquery-ui-sortable'); </script> <script> jQuery.sap.includeStyleSheet("resources/css/dashboard.css"); sap.ui.localResources("dashboard"); var view = sap.ui

move draggable between droppable + sortable containers

风流意气都作罢 提交于 2020-01-06 08:15:24
问题 I've got a scenario where I have multiple droppable containers, that are also sortable . I need to be able to drag clone s from my source draggable , and drop them on any of the droppables . Within each droppable , the items need to be sortable . I also need to be able to drag a draggable from one droppable to another. Here is a JSFiddle I've started as a proof of concept that I can't quite get working. There are two issues I can see: If you drag two items onto the first (left-most) droppable

Accessing WordPress's TinyMCE iFrame

时光毁灭记忆、已成空白 提交于 2020-01-06 03:11:28
问题 Using jQuery I'm trying to manipulate the WordPress content editor, which uses TinyMCE inside of an iframe. I can't seem to get the following code to work as intended: jQuery(document).ready(function($) { $('#content_ifr').ready(function() { $('#content_ifr').contents().find('body').css('background-color', '#f33'); }); Regardless of whether I use ".ready()" or ".load()", the event will fire before the TinyMCE editor (the body of the iframe) is completely finished loading. However, the

How to replicate a draggable/droppable instance in jquery after first instance completed

空扰寡人 提交于 2020-01-05 10:11:01
问题 I have a small jquery draggable/droppable app I am building. You can see it here: http://jsfiddle.net/franco13/AwnJA/1/ I need to do the following and I am new to dragging and dropping in jquery, so thank you for assisting. I wish to: prevent the blue box from being dragged to box 2, until it has been dropped in box 1 once the blue box is dropped into box 1, I want to make it draggable again so it can be dropped into box 2 while leaving a clone behind like this: $( init ); function init() { $