draggable

Jquery draggable/droppable and sortable combined

℡╲_俬逩灬. 提交于 2019-12-05 04:22:24
I was asked to create a grid of squares, where each square may or may not contain a link and these links should be able to be moved about the grid. I figured that draggable/droppable would be the way to go and it works fine, however, now we want to be able to have the draggables swap about if one is dropped on top of another. So it looks now like sortable would have been the way to go. However, sortable looks more like it's meant for lists whereas I haven't written it like a list. Is there an easy way to make what I have so far work, or do I need to totally rewrite this using sortable? I'm new

Draggable is blocking touch event

随声附和 提交于 2019-12-05 03:36:53
问题 I'm attempting to use drag to move a div back and forth. This part works fine until the div has scrollable content. This isn't a problem on a desktop because of the scrollbar, but a problem occurs on touch devices. Because the touch event is conflicting with the drag event, I'm unable to scroll the content. I tried to create a condition to detect if the drag was more horizontal than vertical.. My hope was to prevent the dragging during a vertical touch interaction, but the UI drag method

JQuery draggable image with saved position

痞子三分冷 提交于 2019-12-05 03:32:47
OK it's getting awkward, already searched and tried for about 5 hours and I'm just running in circles... The scenario is easy: It's the header image of a user profile, it can be dragged into an position and then the top position of the image get's saved into a DB. Thanks to Beetroot-Beetroot's "containment: 'parent'" I am down to this piece of code, which actually reacts as I want it to! Except for one big problem. The Picture just jumps either to the top or the bottom. There is no smooth scrolling? If I change the 'parent' to -'parent' it scrolls nicely but... the containment of course isn't

vue 拖拽框架 draggable

不问归期 提交于 2019-12-05 02:56:49
直接使用 npm i -S vuedraggable 页面使用 <template> <div class="addProduct"> <el-dialog title="流程" :visible.sync="addTemplate" width="900px"> <div class="flex"> <div class="addTemplate-left"> <div @click="addType=false">完整三代</div> <div @click="addType=false">完整三代</div> <div @click="addType=false">完整三代</div> <div @click="addType=true">+新增流程</div> </div> <div class="flex addTemplate-content"> <div class="addTemplate-content-left"> <div class="addTemplate-content-left-title">完整三代流程</div> <div style="margin:0 15px 8px 15px;" v-if="addType"> <div style="padding:10px 0;"> <span class="colorRed">*</span>流程名称

Scroll div when element is dragging without moving mouse

China☆狼群 提交于 2019-12-05 02:40:37
问题 I developped a code including a table with all its cells as droppable. The table container is div with a fix height and a scrollbar. I would like drag an element (yellow square in my example) into the last table cell at the bottom of my table. Everything works fine, but to activate the scrollbar of my div container when I am dragging the element, I must move the mouse all the time . Is there a possibility to scroll down automatically when my element is dragging near the bottom of my div

jQuery sortable with droppable

梦想的初衷 提交于 2019-12-05 02:24:18
问题 My fiddle: http://jsfiddle.net/Yc9WY/42/ What you'll see here are two groups, each with 3 droppable containers defined. You can move events from group 1 to group 2, and into any slot. This works just fine. Once a group is full, I would like to give the user the ability to sort that group by moving events up and down. They should still be able to move the event out of the group if they choose however. You'll see my commented out code where I began to integrate the sortable library, but am

draggable without jQuery ui

旧街凉风 提交于 2019-12-05 00:48:06
问题 How to make a element draggable without using jQuery UI? I have this code: <script type="text/javascript"> function show_coords(event) { var x=event.clientX; var y=event.clientY; var drag=document.getElementById('drag'); drag.style.left=x; drag.style.top=y } </script> <body style="height:100%;width:100%" onmousemove="show_coords(event)"> <p id="drag" style="position:absolute">drag me</p> </body> The problem is that I want to drag while the user the pressing the mouse button. I tried

Drag and drop UIButton but limit to boundaries

戏子无情 提交于 2019-12-04 20:51:08
I’m not asking for givemesamplecodenow responses, just a nudge in the right direction would be much appreciated. My searches haven’t been any good. I have a UIButton that I am able to move freely around the screen. I would like to limit the drag area on this object so it can only be moved up and down or side to side. I believe I need to get the x,y coordinates of the boundaries and then restrict movement outside this area. But that’s a far as I have got. My knowledge doesn’t stretch any further than that. Has anyone implemented something similar in the past? Adam So let's say you're in the

dragging from a sortable list to a drag and drop plugin

二次信任 提交于 2019-12-04 20:33:58
I am trying to allow dragging from a sortable list to a dynatree. My initial though was to specify something like this: $('#ews_pgs_clpbrd_items').sortable({ connectToDynatree: true }).disableSelection(); dynatree does not register the drag and drop events for the sortable items. so I tried $("#ews_pgs_clpbrd_items").sortable().disableSelection(); $("#ews_pgs_clpbrd_items li").draggable({ connectToDynatree: true, connectToSortable: "#ews_pgs_clpbrd_items" }); This allows the items in the sortable list to be dragged to the dynatree but it no longer allows sorting. When I try to sort I get the

Save position of Jquery draggable DIVs using php

廉价感情. 提交于 2019-12-04 14:44:23
问题 There are a lot of solutions out there as to how to save the position of draggable DIVs but I haven't found any that will help with using a While loop in php. I have a database of "needs" and I want to display all the "needs" that match the persons username and status=inprogress. This could be 1 need or 1,000,000 needs depending on if the criteria is met. I want to save the position of the need (DIV) automatically when it's moved. Is this possible? I wanted to store the values in a database