drag

How to make simple customized drag and drop functionality in angular2 with file upload option

不打扰是莪最后的温柔 提交于 2019-12-08 13:02:15
问题 Please check the code HTML file <div class='multiple'><span *ngFor="let filename of fileList" class="fileLoaded">{{filename}}<dew-icon [options]="{icon:'cross'}" (click)="deleteItem(filename)" class="file-close"></dew-icon> </span> </div> <label for="file-upload-{{Id}}" class="custom-file-upload"> <span><dew-icon class='sizeIcon' [options]="{icon:'lnr lnr-move'}"></dew-icon></span> <i class="fa fa-cloud-upload"></i> Drag and Drop /Browse </label> <input accept="application/pdf,application

How to manually trigger the drag event of d3

一世执手 提交于 2019-12-08 12:48:07
问题 All: Suppose there are two layers( the top one is SVG:PATH, the bottom layer is a SVG:RECT, the top layer covers the bottom layer), I want to apply D3 drag to the RECT layer and mouseover to PATH layer, could anyone show me how to do that? THE CODE BELOW CAN ONLY WORK WITH THE path LAYER: var svg = d3.select("svg"); svg.style("width", "400px") .style("height", "400px") .style("border", "1px solid grey"); var r = svg.select("rect") .attr("width", "300px") .attr("height", "300px") .attr("x",

Firefox: Unable to Drag element child of <a> hyperlink

喜欢而已 提交于 2019-12-08 10:25:04
问题 Consider the following markup: <a class="link" href="#"> <sup draggable="true">Foo</sup> Bar </a> Now attach a dragstart event to the sup element: $(document).ready(function () { $("sup").on('dragstart', function(e) { console.log('shikaka'); }); }); This event will never fire. I've been researching and in Firefox, links are draggable by default, so I thought that this might work: $(document).ready(function () { $(".link").on('dragstart', function(e) { e.preventDefault(); e.stopPropagation; /

android : Dragging view within the layout size (sceen size)

霸气de小男生 提交于 2019-12-08 09:35:47
问题 I want the imageview to be draggable only within the screen size . But the problem with the below code is , only left and top margin stops the imageview ,how to implement if statement for right and bottom margin so that it stops the view from going out of focus. below is the code , Thanks in advance public boolean onTouch(View view, MotionEvent event) { DisplayMetrics displaymetrics = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(displaymetrics); float screenHeight =

Implement panning while keeping nodes draggable in d3 force layout

我与影子孤独终老i 提交于 2019-12-08 07:20:57
问题 I use the d3.layout.force to visualize graph structures. And I want both node dragging feature and panning feature. (By 'panning', I mean something like google maps behavior.) As shown in several d3 examples, nodes can be made draggable by nodes.call(force.drag) . And panning can be implemented by d3.behavior.drag . However, it seems they can not be used simultaneously. Here is a code example: var width = 400, height = 300; var svg = d3.select('body').append('svg').attr({width: width, height:

Drag and drop with the help of jQuery

时光总嘲笑我的痴心妄想 提交于 2019-12-08 06:19:08
问题 I'd like to be able to move an object into another with the function draggable of jQuery. I can move an object in the container and able to move in it. But when I try to add helper to objects to move, this no longer works. I want that when I select an item to deposit it in my container, it duplicates itself. Below is what I have managed to do for the moment: JSFiddle $(".drag").draggable({ opacity: 0.7, snap: '#drop', cursor: "move", revert: "invalid", //helper: "clone" }); $("#drop")

drag using javascript and css

拈花ヽ惹草 提交于 2019-12-08 04:30:14
问题 I want to create a web page in which a specific image is capable to drag. so this was my code. <! doctype html> <html> <head> <title> </title> <script src="13.8.js"></script> </head> <body> <img src="file:\\C:\Users\X555\Pictures\poster\yellowflowers.png" id="image" alt="white lion"> <script> var mustDrag; var image function set() { image = document.getElementById("image"); image.addEventListener("mousedown", function () { mustDrag = true }, false); window.addEventListener("mouseup", function

How do you recognize drag gestures

我是研究僧i 提交于 2019-12-08 03:54:31
问题 I have several buttons in my view built using IB. Each button triggers a short audio sound. I want to be able to drag my finger over them to trigger them... just like you are dragging your finger over piano keys (don't worry I am not making a piano app) I cant figure out how to recognize a touch outside the button and then inside it. Any ideas? Thanks 回答1: As your buttons subclass from UIControl, you can use UIControl's implementation of recognition of gestures. Look at UIControl's - (void

Disable drag of JFrame

耗尽温柔 提交于 2019-12-08 02:39:46
问题 I want to ask how to make frame can not drag when the application is running? And then how to disable maximize, minimize button (title bar)? I'm using JFrame . 回答1: Just add the below line it removes the window decorations like close maximise and minimise(titlebar). This itself disables the dragging only with mouse events. frame.setUndecorated(true); 回答2: You can use a JWindow instead of a JFrame . There is no title bar, so the user won't be able to move it. setResizable(false);

Does Android browser lock DOM on touchStart?

南笙酒味 提交于 2019-12-08 01:54:30
问题 I'm trying to build a menu with 5 blocks that the user can spin around. You can see a demo here: http://m.iijax.com/menu.php Works fine on iPhone, (if a little sluggish sometimes, but that is beside the point :p ) if i draw my finger more then 90 pixels (which i set as a limit) in either direction the menu spins. On Android (2.1, a Samsung Galaxy S) however the menu does nothing until i release my finger from the screen, I've tried adding an alert on the 2 functions that changes a bunch of