draggable

How to make an input field draggable [closed]

。_饼干妹妹 提交于 2019-12-08 07:45:18
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I have a dropdown/input field, but I want to put a draggable event into it. When I drag it for the first time, it moves smoothly, but when I start to edit the text inside the input field, I can't seem to drag it around anymore. I've been researching the on the draggable methods but no luck. Basically I have a

Make image draggable and resizable within div

老子叫甜甜 提交于 2019-12-08 07:45:01
问题 Let me share what I actually want - Create a div. Onclick add an image to the div. Make this image draggable and resizable. We would be able to add multiple image into the div. Below is my code I've done so far - JS : $.fn.extend({ draggableChildren: function(selector) { $(this).on("mouseover", selector, function() { if(!$(this).is(":ui-draggable")) $(this).draggable({ containment: "parent" }); }); return this; } }); $.fn.extend({ resizableChildren: function(selector) { $(this).on("mouseover"

input text is being displayed double in divs

不问归期 提交于 2019-12-08 07:12:59
问题 can someone please help me? i have been trying for days but this has not been working properly my problem is that when i try to enter some text it is being displayed double one in each div if you need further explanation please ask. try typing something and you will see what im talking about when i edit them one of them changes color and the other size and font the reason is because the class are different each div has a different class on purpose this is the site http://amp.site88.net/ var z

jQuery UI Draggable jumps at the first drag

旧街凉风 提交于 2019-12-08 06:45:11
问题 Please refer to this jsFiddle example. At the first time dragging the draggable, it jumps out of viewable area. Yet it is still draggable. It just doesn't stick to mouse cursor. The following code is the main JS code I use. $('.sortable').sortable({ revert: true }); $('.draggable').draggable({ connectToSortable : '.sortable', revert : 'invalid' }); 来源: https://stackoverflow.com/questions/14524944/jquery-ui-draggable-jumps-at-the-first-drag

Kendo Ui draggable like windows desktop

£可爱£侵袭症+ 提交于 2019-12-08 02:55:38
问题 I need to simulate a desktop icon drag and drop, i do this: $(".draggable").kendoDraggable({ container: $("#desktop"), hint: function() { return $(".draggable").clone(); }, dragend: function(e) { console.log(e); console.log(e.currentTarget.attr("src")); e.currentTarget.css("top",e.y.location); e.currentTarget.css("left",e.x.location); } }); but im not sure if is a nice way and the drag roll back effect break my solution. Hava a simple way to do this with KendoUI (No Jquery UI draggable). Any

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

走远了吗. 提交于 2019-12-08 02:45:35
问题 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…

CSSMatrix equivalent in Firefox?

元气小坏坏 提交于 2019-12-08 02:43:51
问题 I'm currently developing a tiny "draggable for mobile widget", basically it implements only part of the interface of the jQUery UI Draggable widget (The part I needed for my project). I Know I can simulate the mouse events and make the jQuery UI Draggable to work properly on the mobile/tablet platforms, but the main issue with that approach is that it does not feel smooth enough, and since the CSS3 Transforms are hardware accelerated, using translate3d instead of changing the top, left

Remembering a jQuery draggable tool palette position between page refreshes

喜夏-厌秋 提交于 2019-12-08 01:48:44
问题 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)? 回答1: Cookies are a fine option - you can use the functions by PPK like this: $('#palette') .css({ top: readCookie("palletteY")*1, left: readCookie("palletteX")*1 })

基于svg.js实现可编辑的图像(1)

给你一囗甜甜゛ 提交于 2019-12-07 23:52:17
一、关于svg.js 首先是svg.js的git地址 https://github.com/svgdotjs/svg.js svg.js主要用于在页面绘制svg图像,关于svg图像可以参见w3school的介绍详细地址如下: http://www.w3school.com.cn/svg/svg_intro.asp 二、具体实现 大致的功能如下: 实现可以拖动,可双击编辑,可拖动改变长短,线条可旋转以及一个可点击改变大小,可更改内容的二维码。 首先引入jquery和svg.js然后引入svg.select.js、svg.resize.js、svg.draggable.js,这几个都是svg.js的扩展,具体地址是: https://github.com/fuzzyma/svg.resize.js https://github.com/Fuzzyma/svg.select.js https://github.com/svgdotjs/svg.draggable.js 页面上先写一个div用来存放svg图像: < div id = "drawing" ></ div > 然后新建一个js文件来绘制svg图像: ( function (global) { var svgItem; svgItem = global.svgItem = {}; svgItem.param = {

Draggable CALayer

本小妞迷上赌 提交于 2019-12-07 17:58:44
问题 Any way of making a CALayer draggable by the user? If so, how? (In Cocoa - Mac) 回答1: 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