draggable

Parenting D3.js-Nodes for dragging

空扰寡人 提交于 2019-12-13 05:24:01
问题 I have a network of nodes and links. One of them has a fixed position in the center but is draggable, the others are in a force field around the centered one. If the user drags any node, the others will be draged behind him, because the are linked. Is there a possibility to drag the others with the centered node, but keeping the drag-event of the other nodes single? thanks for thinking about it, David edit: if someone knew a possibility to set a dragg-listener for all the other nodes to the

Netvibes like “draggable boxes” with javascript

点点圈 提交于 2019-12-13 04:38:13
问题 Do you know any project/framework in javascript (jquery or anything else) that has nice draggable windows that snaps in some fixed places like netvibes has? I found jPolite v2 but it seems a little too complex for what I want to do. Any idea? 回答1: You could use jQuery UI sortable. Look at the portlet example 来源: https://stackoverflow.com/questions/2751915/netvibes-like-draggable-boxes-with-javascript

Cancel draggable div on start [closed]

ⅰ亾dé卋堺 提交于 2019-12-13 04:33:33
问题 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 . What I have: Draggable divs that have an alert on start and revert when dropped. What I need: When user tries to drag the div, an alert pops up saying you can't drag it and the dragging stops before it even goes anywhere. 回答1: You can return false within the start() method to accomplish this: $("#draggable")

Google maps api v3 Two markers one fixed one dragged

心已入冬 提交于 2019-12-13 04:24:06
问题 I'm using two markers for getting distances A and B The Javascript: var rendererOptions = { draggable: true }; var Mapa = { // HTML Nodes mapContainer: document.getElementById('mapa'), dirContainer: document.getElementById('trasa'), fromInput: document.getElementById('from-input'), toInput: document.getElementById('to-input'), travelModeInput: document.getElementById('travel-mode-input'), unitInput: document.getElementById('unit-input'), // API Objects dirService: new google.maps

How do I make the arc of the sun stop at the left end of the page?

混江龙づ霸主 提交于 2019-12-13 03:56:42
问题 I made the sun draggable in an arc, but I want the arc to stop at a certain point which in this case, is the left end of the page. Right now it goes on forever on the left, but I want it to stop. How can I do that? var width = 300; var sun = $("#sun"); sun.draggable({ axis: "x", drag: function() { var x = sun.offset().left + (width / 2); var total = $(window).width(); var heightPct = Math.pow((total / 2) - x, 2) / Math.pow($(window).width() / 2, 2); console.log(x, $(window).width(), heightPct

Why does event on drag not have any effect with jQuery implementation?

[亡魂溺海] 提交于 2019-12-13 03:45:27
问题 I want to create a horizontal menu that is contained by 300px and items can be dragged horizontally if containment space is not enough. The implementation consists of jQuery 2.1.4. and jQuery mobile 1.4.5 and jQuery ui 1.12 Somehow the on drag event is not working, no errors at all, just not working. I tried a minimal example and it works, but my code in the implementation does not: https://codepen.io/anon/pen/YMaVyX Implementation: https://watchgurus.de HTML <div class="draggable"> <nav

How to drag and drop directory and get only the path of it? [closed]

走远了吗. 提交于 2019-12-13 02:26:12
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 4 years ago . How can i drag and drop directory in windows and get the path of the directory - that is in order to not to write the path by myself all the time ( sometimes its really long ). I tried to look for a solution but couldn't find as most drag and drop that relate to directory or files

jQuery Draggable, convert position to percentage

僤鯓⒐⒋嵵緔 提交于 2019-12-13 01:54:25
问题 I'm not sure how to do this. Im using jQuery draggable, and I need to capture grid position: $("#draggable .item").draggable({ containment: "#dragablle", snap: '.gridlines', stop: function(event, ui) { console.log(ui) } }); Looking at the object receiver from stop event : Object { top=178, left=950} I need to convert top and left values into percentage, so I can apply to .item element as inline style. Parent "#draggable" width and height will be dynamic, so that's why I need percentage

Remove in Jquery divs with draggables and resizables

匆匆过客 提交于 2019-12-13 01:17:50
问题 i have a question: When you make a div as draggable and resizable and later when you want remove, i need destroy draggable and resizables? The same for droppables. Example: $("element").draggable("destroy").resizable("destroy").remove(); or only need?: $("element").remove(); The same for when you want replace html of a div that have elements with draggables: $(".parent .elements").draggable("destroy").resizable("destroy").parent().html(newHtml).find(".newsElements").draggable().resizable();

Need Id of BOTH draggable and droppable ID's jqueryUI

核能气质少年 提交于 2019-12-13 00:49:13
问题 I can get the id of the item I have dropped on with the below code, but if i try to change the alert to get the id of the dragged item, nothing happens. e.g. alert(ui.draggable.attr('id') ); $(function() { function dropCallback(e) { alert("The firing droppable item was " + e.target.id ); }; $("#draggable").draggable({axis:"x"}); var dropOpts = { accept:"#draggable", drop:dropCallback, greedy:true }; $(".target").droppable(dropOpts); }); 回答1: Try using... drop:function(event,ui) {alert($(ui