drag-and-drop

get src from draggable img

人盡茶涼 提交于 2019-12-25 03:14:06
问题 i have this little code to drag & drop images: $("img").draggable({ revert: true, opacity: 0.7, cursor: "move", cursorAt: { cursor: "crosshair", top: -5, left: -5 } }); $('#mybox').droppable({ drop: function () { $(this).append('<div style="float:left;"><img src="http://dummyimage.com/42x40/000/fff.jpg"></div>'); } }); the idea is: when I drag a image, instead of show the dummy image, show the image itself, but how i can get the src from image from draggable. Any Idea? Thanks in advance. 回答1:

Understand drop in NStableView

怎甘沉沦 提交于 2019-12-25 03:05:04
问题 I have a NStableview with datasource and bindings in IB. DataSource object get they value from NSOpenPanel Action. Then, a function receive URLS from openPanel, and do the dirty work very well. So, what i would achieve is offer an alternative to openPanel via Drag operation. Sincerely i need to tell that i don't have quite skill about drag and drop, and after read and read documentation about it, still have o couple of fly in my hand.... At the moment i can drop file in tableview, receive the

drag&drop not working in Opera 11.62 and Safari 5.1.4

强颜欢笑 提交于 2019-12-25 02:33:21
问题 I put this code in a test HTML file: <head> <script> f=function() { el=document.getElementById('dragdiv'); el.ondragover=function(){return false;}; el.ondragenter=function(){return false;}; el.ondrop=function(event){ el.innerHTML=event.dataTransfer.getData('Text');}; } </script> </head> <body onload='f()'> <div id='dragdiv'>DROP HERE ------------------------</div> <img src='image.jpg'></img> (Tags were removed) It works in Chrome but not in Opera and Safari because the mouse cursor does not

Constrain dragging to local axis of object

ぐ巨炮叔叔 提交于 2019-12-25 02:22:56
问题 I'm trying to implement something very similar to what 3D modeling programs do, when dragging an object along a local axis. The main difference is, that you don't move the cursor around the screen, instead you freely move the camera and the cursor is always in the middle of the screen. Kind of like a first person game. Imagine pointing the camera at the face of the cube below, marked with a blue cross (the cursor). You press and hold the mouse to "grab" the cube. The dragging of the cube

Flex: Why are TileList images disappearing on drag?

南楼画角 提交于 2019-12-25 01:44:52
问题 I'm developing a Flex Air (desktop) application that loads images from the local filesystem into a TileList. The user will then be able to drag (copy) these images out of the list onto another control. I've finally got the images showing up correctly (and not disappearing after scrolling the TileList) but they seem to disappear from the TileList at the start of a drag operation. I come from a .NET background and am just learning AS3/Flex, so if you see me using any anti-patterns here, feel

Drag N Drop controls in a GridPanel

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-25 01:44:28
问题 I have been fooling around with dragging and dropping controls in a grid panel in delphi 2010. Move a panel/button/whateever the contents are from one cell to another cell. Replacing existing or swapping places. I have not figured out how I know which cell was dropped on because they work with column indexes and also row indexes. so if I have a gridpanel which has 3 columns and 3 rows, and I have a button in cell 1/1... and I drag that button from 1/1 into 3/3 how can I get that cell location

Drag & drop in HTML

我是研究僧i 提交于 2019-12-25 01:26:01
问题 Hi there I'm writing a little calculator for exercise. There is no logic yet. Still I wanted to allow the user to drag the calculator around the browser. So I nested my Calculator elements in this -Tag and implemented some Drag&Drop-logic (which is mainly from a tutorial). Still it doesn't work. Does anybody see what I do wrong? <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text

How to use, dragstart, dragend, click, mouseup, mousedown with three divs together and keep them all separate but equal

夙愿已清 提交于 2019-12-24 23:13:17
问题 OK, I'm spinning my wheels: My quandary is this: Here's my HTML: <!-- PARENT OUTER WRAPPER --> <div id="avatarmoveable" class="moveablecontainer avatarBubble" title="Click on an HOLD to drag avatar" (click)="avatarMoveClick($event,'moveavatar')" ngDraggable> <!-- OUTER WRAPPER --> <div class="avatarsays box-opener"> <!-- DEBUG CONSOLE OUTER WRAPPER --> <div class="debugcontainer" title="Click to OPEN DEBUG Console or say, 'OPEN DEBUG CONSOLE'." *ngIf="isVisible" (click)="showHideCSMModal(

[jqplot]Get the point index when dragged

对着背影说爱祢 提交于 2019-12-24 22:25:23
问题 Is there any way to get the index of a dragged point in JQPlot? I want to change the pointLabel value when the point have moved. I know that JQPlot do it itself but only with integer. Or I work with decimal values. I'm trying this: $("#tooltip2").bind('jqplotDragStop', function (seriesIndex, pointIndex, pixelposition, data) { $(this).find('.jqplot-series-1.jqplot-point-'+pointIndex) .html(''+Math.round(pixelposition.yaxis * 10) / 10); }); But none of the parameters give me the current point

C++ - arguments to main

大兔子大兔子 提交于 2019-12-24 21:59:59
问题 very basic question. i try to write a program that outputs the filenames of the files dragged onto the exe. i followed this guide for main arguments: http://publications.gbdirect.co.uk/c_book/chapter10/arguments_to_main.html this is my code: #include "stdafx.h" #include <iostream> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { cout<<"num arguments: "<<argc<<"\n"; while(argc--) printf("%s\n", *argv++); cout<<"press any key"; getchar(); return 0; } but all it output's is: if i run