FAQ Database Discussion Community


jQuery draggable clone size while dragging

jquery,resize,clone,draggable
I'm developping a drag-and-drop application. I have a droppable container and draggable. $( "#dragshock" ).draggable( { helper: "clone", cursor: 'move', drag: resizeContainer } ); The function called by drag is this one: function resizeContainer(e, ui) { var defaultSize = 108; var factor = ((ui.position.top)/19); var correcteSize = defaultSize + factor;...

AS3 Draggable layer/mask on y axis

image,actionscript-3,draggable,mask,movieclip
I'd like to create this exact example: http://www.nytimes.com/2008/12/28/nyregion/18thennow.html?_r=2& however have the drag occur on the y axis instead of the x. I was working with some basic code, but wondering how to lock it in place? myImage.mask = myMask; stage.addEventListener(MouseEvent.MOUSE_DOWN, fMouseDown); stage.addEventListener(MouseEvent.CLICK, fMouseUp); function fMouseDown(e:MouseEvent):void { myMask.startDrag(); } function fMouseUp(e:MouseEvent):void...

unity3d - Cannot move a parent empty gameobject

unity3d,parent-child,draggable
I have an empty game object which is a parent of several childs that create parts of a tank, The problem is I wrote a script to make that parent object move according to mouse, but when I apply it to it does nothing, whilst when I apply it to...

jquery draggable/droppable div in multiple divs

jquery,table,draggable,droppable
I want to create a table where each cell can contain an element (div) that can be dragged and dropped in other cells. It seems that the element can be dropped only the origin div. I don't understand why it doesn't work. <style> .over { border: solid 4px #ACFA58; }...

Add 'Remove/Delete' option to draggable object

jquery,object,draggable
I have a draggable object i would like to provide the option to close/remove. I have been able to add the "close" text to the object, however when i click on the "close" text the object is not removed. I used the code from here Below is my code //Add...

How to drag back div to first position when it drags to out of screen

javascript,jquery,draggable
I have a draggable div in jQuery that can be dragged from its handle. I need to let it revert to its original position when dragged off screen. html: <div class="mcwindow"> <div class="wm"></div> </div> jquery code: $(function() { $( ".mcwindow" ).resizable(); $( ".mcwindow" ).draggable({ handle: ".wm" }); $( "div, p"...

div Draggable et Rezible : doesn't work with containment

jquery,jquery-ui,draggable,resizable,containment
I want a resizable and draggable div on a bigger div that is contained in a little div (to have a scroll Bar) like this: <div id="hgcScroll" style="width:600px;overflow:auto"> <div id="hgcRegle" style="width:800px"> </div> <div id="hgcDeplacable"> </div> </div> Then in my jQuery I have this: $("#hgcDeplacable").resizable(); $("#hgcDeplacable").draggable(); $("#hgcDeplacable").draggable({ containment: "#hgcScroll", axis: "x",...

Disable scrolling with dragabble div

jquery,scroll,draggable
So i have a div which is draggable. When i drag it close to one of the edges on the webpage the whole website scroll. Can i disable this funciton? (I can basicly use the div to move around the webpage, but i want it to be limited to where...

how dragged image with a min and max value?

ios,objective-c,uiimageview,draggable
I have this code for increase height of a image. - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ UITouch *touch = [[event allTouches] anyObject]; touchStart = [[touches anyObject] locationInView:self.image]; touchStart2 = [[touches anyObject] locationInView:self.tableView]; isResizingLR = ( self.image.bounds.size.height - touchStart.y < kResizeThumbSize ); } - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{ CGPoint touchPoint = [[touches...

jqgrid draggable not working after paging

jquery,jqgrid,draggable,jquery-ui-draggable
I am using draggable jqgrid.But the issue is the rows are draggable only in the first page.After I change the pagination, the draggable for rows is not working.Can you please help me. Below is my code for making jqgrid rows draggable. function GetAllCompanyProducts(productData) { /// <summary>method to load the Proposal...

Get information from template after drag with jQuery

javascript,jquery,meteor,draggable
I am trying to get the user ID from a photo at the moment I stop dragging it. I am using Meteor with JQueryUI Draggable. As the photos are rendered, I print the user to the console which works fine and gives the unique user ID correctly. When I drag...

Draggable is not working

javascript,jquery,css,drag-and-drop,draggable
I am trying to implement a draggable (drag & drop) picture using a script that is included at the header of my html file. I have 3 separated files for this project; html, css and js. However, when I upload it to my localhost, the draggable function is not working...

How to get Famo.us draggable modifier's render node

draggable,famo.us
I am trying to get parent renderNode of a draggable modifier on 'end' event, is there any api to get a renderNode to which draggable belongs to? My code is as follows : /*globals define*/ define(function(require, exports, module) { var View = require('famous/core/View'); var Surface = require('famous/core/Surface'); var Transform =...

jQuery ui drop (move) elements between tabs

jquery,jquery-ui,tabs,draggable,droppable
I want to realize moving elements between tabs using jquery ui. If I want drop element to another tab - droppable block (.elements) doesn't catch hover event (outline doesn't want to apply), but dropping works correctly. $( "#tabs" ).tabs(); $('.elements').children().draggable({ appendTo: 'body', opacity: 0.9, helper: "clone", zIndex: 1000, cursorAt: {...

How can i drag a hidden child element

jquery,jquery-ui,draggable,jquery-ui-draggable,jquery-draggable
I'm using Jquery-Ui for Drag and drop elements . From the left box i would like to drag a hidden elements to the right box. The result is: When i'm dropping the elements, they are appear (display:block) with them parents. Link to JSFIDDLE The problem is that i can't define...

can you tell if one element is touching another using javascript

javascript,html,draggable
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...

Events triggered on jquery dragging

javascript,jquery,jquery-ui,draggable
Is there a way to have an event triggered when you drag an item to a certain place, or drag it a certain amount? For example, with a slider you can have an event happen when you drag the slider like this: $( '.slider' ).slider( { slide : function(){}, change...

Sortable & Droppable issue with 'connectToSortable' changes DOM structure

jquery,jquery-mobile,drag-and-drop,draggable,sortable
I'm creating a a tool to build a form builder of sorts using jQuery UI .draggable, .sortable and .droppable features. The tool itself's does the following: Includes a list of component in which the user can include (drag) to create a form These components can be dragged into a section...

JavaScript/jQuery drag and drop element between two iframes

javascript,jquery,iframe,drag-and-drop,draggable
I have a page with 2 iframes, side by side, both from the same domain. I want to drag'n'drop an element from a specific drag-zone (e.g. a table) of one iframe to a specific dropzone (e.g. a list) on the other. I checked all related questions on stackoverflow and elsewhere,...

Jquery: Move a draggable element among containers

jquery,html,css,draggable,droppable
In JQuery, I am trying to drag an element from Draggable to a Droppable table with several cells, then drag the element between these cells as in this demo http://fiddle.jshell.net/c6vL61fb/4/ However, I got a problem that the element only be positioned automatically for the first time when move from draggable...

Change text of HTML5 draggable element's “clone” while dragging

javascript,jquery,html,html5,draggable
I'm trying to set the text of an HTML5 draggable element's clone (the one that appears when you start to drag and lasts till you end the drag) to something different than its text node when it's dragging. Consider this example: http://jsfiddle.net/dwpLzuh5/ I've tried (using other examples on the internet...

jQuery UI Sortable & draggable helper

javascript,jquery-ui,draggable,sortable
I try to make draggable &sortable content with jQuery UI when i use: helper:clone property it's work perfectly, but i don't want to clone elements. I want move them and when i use default helper then elements are not sortable. Elements are on the stack in one place, instead of...

Snap to parent grid on start of drag

javascript,jquery,html,jquery-ui,draggable
I'm fairly new to JavaScript & JQuery, so apologies if I'm missing a trick or two. I've figured out how to get JQuery UI draggable objects to use the grid option, and, once the page has loaded, "snap to an imaginary grid" which all draggable objects have reference to (explained...

Java draggable JPanel within JScrollPane with boxLayout

java,draggable,jscrollpane,boxlayout
I have (1)JPanel containing (2)JPanel with BoxLayout. (2)JPanel can contain any number of (n)JPanels with FlowLayout (no of orders). (1)JPanel is put into JScrollPane using JScrollPaneLayout. I want (n)JPanels to be draggable to switch positions of (n)JPanels, but still maintain BoxLayout. For example I have JPanel with BoxLayout and 4...

jQueryUI: how to restrict droppable area to multiple divs?

javascript,jquery,jquery-ui,draggable,jquery-ui-draggable
It feels like the question is already answered: How to select multiple areas in containment using jQuery UI draggable Set more than one containment in jQuery Draggable I have 3 timelines and some draggable elements to place there. For some reason I cannot get it to work. This is the...

Drag nodes like in a patience/Klondike card game

java,javafx,draggable
I'm doing a Klondike game. The logic is all working. I'm just having trouble with the UI in javafx. I've been trying to move/drag the cards from the 'tableau pile' arround without the expected result. My card is a ImageView with an Image inside. The cards are inside a Pane:...

Alpha value of 3d chart's rotation ? where is the center?

highcharts,draggable
My chart: http://jsfiddle.net/gh/get/jquery/1.9.1/highslide-software/highcharts.com/tree/master/samples/highcharts/demo/3d-scatter-draggable/ beta: I think that the value "beta" of 3d draggable scatter chart, is at half of xAxis (so at the half of "max-width").. alpha: but alpha ? where is the center of rotation for Alpha ? I ask you this, because i would like to add an...

jQuery UI Draggable - drag beyond absolute positioning [closed]

javascript,jquery,css,jquery-ui,draggable
I am unable to see the elements that i am dragging once they leave a parent element that has absolute positioning. (Cant see the draggable helper as it moves) Check out the example at http://nairobi.io/tests/jquery-ui-draggable Kindly help me fix this problem....

Programmatically reorder or move elements in Draggable + Packery (Masonry)

javascript,jquery-ui,draggable,masonry,packery
Here's a fiddle for this: http://jsfiddle.net/bortao/00uvL60c/1/ When i press "move left" / "move right" I want to send the block left/right. I do this by reinserting it on the dom structure with el.insertBefore(el.prev()) / el.insertAfter(el.next()) but this don't work since it keeps the left / top coordinates, and also don't...

Drag a loaded object with threejs?

three.js,draggable
I've been trying to get a loaded object to be draggable in threejs. The first block of code below (which is only a snippet) displays a cube and I can rotate the view, but not the cube itself. The second block of code creates a box that is draggable, but...

Bing maps draggable infobox

javascript,drag-and-drop,draggable,bing-maps-api
I have pretty simple question. Is it possible to create draggable infobox with Bing Maps Javascrtipt API? Ergo when i click on pushpin on map the infobox will be shown and will be draggable within the map div. Thanks!...

Separating click from draggable functionality in JQuery

jquery,click,draggable,drag
Is there a way to separate a click events functionality from a drag events functionality if they are both attached to the same object? I am adding a class on click. My goal for my application is that when a user has 'clicked' and item, that it's draggable functionality is...

How does one initialize/move a camera in a SpriteKit program using Swift?

ios,swift,camera,sprite-kit,draggable
I have a map and it's bigger than the device's screen size, so I want the user to be able to navigate around the map by dragging the screen, similar to Clash of Clans. How can I create a camera view so I can drag the camera around the map?...

Dynamically change element background (gradient)

javascript,css,draggable
Consider situation http://codepen.io/anon/pen/JdGYBN I need to change background color of card "draggable" dynamically while dragging element. But card's background should change in accordance with line gradient color. background: linear-gradient(to bottom, rgba(255,2,2,1) 0%,rgba(242,255,0,1) 34%,rgba(16,255,0,1) 66%,rgba(255,255,255,1) 100%); Not like card "badone" that consist all gradients. Therefore, in top of the container card...