draggable

How can I cleanly resize an iFrame with dragging functionality?

柔情痞子 提交于 2019-12-19 10:33:09
问题 I have an iFrame and I want the user to be able to grab one side of it and drag it to resize it. I don't want it to resize realtime, but rather use an indicator line and when the user releases, it'll resize. I'm using jQuery. Any help? 回答1: Iirc, the classical method is to put the IFrame inside of a div and make that div re-sizable; also make the iFrame's width and height at 100%. If you're using JQuery though, can you not use jQuery.load('uri') instead of an iFrame ? I believe it's

jquery droppable -> avoid multiple drops of the same object

断了今生、忘了曾经 提交于 2019-12-19 10:25:07
问题 I have a container with different draggable -elements and there is a list of some "target" divs, where the user can drop the draggable elements. Example: Imagine, you have a list of "tags" (House,Computer,Car,..) and a list of some documents as target (all documents are part of the div <div id="doclist"> ). So the target is to assign the "tags" to the document using drag & drop. By the way, every tag-Div has an unique id ( <div id="e34a568b2"> ) Code for making the "tags" draggable: $('

pure javascript draggable element

折月煮酒 提交于 2019-12-19 04:11:20
问题 I know there're example of doing this on the web but every example is different and so is my own implementation. I'm trying to figure what's wrong with my implementation since it doesn't work as expected. code snippet: var mousePressX = -1; var mousePressY = -1; document.getElementById("contextMenu").addEventListener("mousedown", function(event) { mousePressX = event.clientX; mousePressY = event.clientY; }, false); document.getElementById("contextMenu").addEventListener("mouseup", function

Interactive BSpline fitting in Python

柔情痞子 提交于 2019-12-19 03:15:50
问题 Using the following function, one can fit a cubic spline on input points P: def plotCurve(P): pts = np.vstack([P, P[0]]) x, y = pts.T i = np.arange(len(pts)) interp_i = np.linspace(0, i.max(), 100000 * i.max()) xi = interp1d(i, x, kind='cubic')(interp_i) yi = interp1d(i, y, kind='cubic')(interp_i) fig, ax = plt.subplots() fig,ax=plt.subplots() ax.plot(xi, yi) ax.plot(x, y, 'ko') #plt.show() return xi,yi The input points P can be of the following form: P=[(921,1181),(951,1230),(993,1243),(1035

jquery drag and rotate to angle

╄→尐↘猪︶ㄣ 提交于 2019-12-18 13:28:12
问题 I am using jQuery UI to drag and drop an image. I also want to rotate the image 360 degrees so I can move and rotate it like in Photoshop. I am using the jQuery rotate plugin to rotate the image on click, but I want to select a corner and drag to rotate the image to any angle. Live JS: http://jsfiddle.net/87jaR/ JavaScript code: var test = 5; $(function() { $('#rotate').draggable({ containment: 'frame' }); $('#frame img').live('mousedown', function(event) { test = test + 15; $(this).rotate({

iOS Swift MapKit making an annotation draggable by the user?

↘锁芯ラ 提交于 2019-12-18 12:55:29
问题 How do I make it possible, using MapKit in Swift, for the user to drag an annotation from one position to another within the map? I have set the annotation view to be draggable, when my map view delegate creates the annotation view, like this: func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -> MKAnnotationView? { var v : MKAnnotationView! = nil if annotation is MyAnnotation { let ident = "bike" v = mapView.dequeueReusableAnnotationView(withIdentifier:ident) if v == nil {

Precise Drag and Drop within a contenteditable

不想你离开。 提交于 2019-12-18 10:13:12
问题 The Setup So, I have a contenteditable div -- I'm making a WYSIWYG editor: bold, italics, formatting, whatever, and most lately: inserting fancy images (in a fancy box, with a caption). <a class="fancy" href="i.jpg" target="_blank"> <img alt="" src="i.jpg" /> Optional Caption goes Here! </a> The user adds these fancy images with a dialog I present them with: they fill out the details, upload the image, and then much like the other editor functions, I use document.execCommand('insertHTML'

Make Inno Setup WizardForm moveable if titlebar is disabled

血红的双手。 提交于 2019-12-18 04:23:17
问题 I want to make an installer with a custom look and disabled the titlebar by setting the BorderStyle to bsNone . Now I cannot move the window anymore. I have looked around and found a solution for Delphi: http://www.chami.com/tips/delphi/010397D.html Can this be accomplished in Inno Setup? I have already looked up the WM_NCHITTEST thing on MSDN but I cannot figure out if and how I can make this work. Edit: After looking around and compiling it using the advanced compiler advanced compiler I

Using jQuery UI Draggable, how to avoid drag when using scrollbar?

∥☆過路亽.° 提交于 2019-12-18 03:58:12
问题 A long time ago I created a dialog box in my application. The dialog is pretty simple, position absolute, centered in the screen via javascript. Now I have added jQuery UI to the application but I do not want to use jQuery UI's dialogs just because they work differently. But I did make my dialog draggable using jQuery UI as it is very easy: $('#dialog').draggable(); There is one problem with that, some of my dialogs have scrollbars. But using the draggable method, if there is a scrollbar, it

jQuery - CSS - Rotate Div by drag mouse event

允我心安 提交于 2019-12-17 23:26:04
问题 I'm searching since a few day without real result, maybe someone can help me here. I've a div on my page (can containt an image, a text area, other), it's draggable and resizable (thanks to jQuery UI), and i want to make it "rotatable", with a handle in a corner to drag and rotate it using css transform (-wekbit-transform, moz-transform) Is it possible ? with jQuery or other Javascript ? Actually i don't care of compatibility with IE. Thanks in advance, Regards 回答1: Using jQuery UI's original