draggable

jQuery iframeFix on a Sortable

怎甘沉沦 提交于 2019-12-22 00:25:57
问题 On my CMS I have a list of thumbnails (Sortable). The thumbnails work great and now I'm writing a plug-in to drag-them to a tinyMCE window. As the tinyMCE window has an iFrame it doesn't work that well. jQuery has an option for Draggables called iframeFix that works exactly as I need. However that list must be a Sortables. I've looked quite extensively on Google and found no-one with my requirements. Has anyone here on StackOverflow done it? Apply the iframeFix to a Sortables? If not... I'm

Draggable UIImageView Partially Transparent & Irregular Shaped

喜欢而已 提交于 2019-12-21 06:39:30
问题 @interface UIDraggableImageView : UIImageView { } .m file - (void) touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event { // Retrieve the touch point CGPoint point = [[touches anyObject] locationInView:self]; startLocation = point; [[self superview] bringSubviewToFront:self]; } - (void)touchesMoved:(NSSet*)touches withEvent:(UIEvent*)event { // Move relative to the original touch point CGPoint point = [[touches anyObject] locationInView:self]; CGRect frame = [self frame]; frame.origin.x +=

How to make a jQuery draggable actually snap to an equally sized droppable

一笑奈何 提交于 2019-12-21 05:24:15
问题 I have my draggable and droppable setup correctly using jquery-ui. They are both the same size, so the draggable should fit nicely on to the droppable. Is there any way to make the draggable snap in to the middle of the droppable so as to completely cover it? It seems if I use the snap: parameter it just snaps to the edges, and not necessarily to the middle of the droppable. 回答1: Would this not do the job, give or take a pixel: drop: function(event, ui) { $(ui.draggable).offset($(this).offset

jQuery Draggable Handler inside IFrame

纵然是瞬间 提交于 2019-12-21 04:52:34
问题 What a mouthful. Basically I have a parent <div> and inside that an <iframe> . I need an element inside the iframe to be the handle to drag the parent div. Is this even possible? I have tried: $(node).draggable("option","handle",$('iframe',node).contents().find('#handle')); $(node).draggable("option","handle",$('iframe',node).contents().find('#handle')[0]); It is targeting the right DOM element but it just won't drag. It might be possible to overlay a hidden div ontop of the iframe but I have

JQuery draggable - No overlap

二次信任 提交于 2019-12-21 04:31:26
问题 is it possible to say "draggable div's -> no overlap" ? I think the mainproblem is the position:absolute; ... right? kind reagards Peter 回答1: There isn't a built-in function for collision detection in jQuery UI draggable, unless you're actually after something like sorting. The closest thing that's built-in to what you want is sortable's plceholder, which looks like this. The short version is collision detection with every dragged element isn't trivial in terms of performance (depending on

How use JQuery/Javascript to scroll down a page when the cursor at the top or bottom edge of the screen?

。_饼干妹妹 提交于 2019-12-21 03:37:04
问题 Simple, I just would like to have it so when a user is dragging an item and they reach the very bottom or top of the viewport (10px or so) , the page (about 3000px long) gently scrolls down or up, until they move their cursor (and thus the item being dragged) out of the region . An item is an li tag which uses jquery to make the list items draggable. To be specific: ../jquery-ui-1.8.14.custom.min.js http://code.jquery.com/jquery-1.6.2.min.js I currently use window.scrollBy(x=0,y=3) to scroll

jQueryUI draggable sets “position: relative” on my draggable divs

我是研究僧i 提交于 2019-12-21 03:29:26
问题 I'm having an odd problem with jQuery draggable this morning, I wonder if anyone else has come across this. I have many small divs inside a large div. They are absolutely positioned: "position:absolute" in CSS for their class, with the actual position itself calculated and set in JS on demand. Now I'm adding functionality to allow these divs to be draggable. But, as soon as I make one draggable, it is given "position:relative" directly on the element, which as you might imagine, seriously

Disabling jQuery drag when scrolling contents of draggable item

微笑、不失礼 提交于 2019-12-21 02:01:35
问题 I don't normally make this sort of question / answer, but figured I'd do so, since I've seen this question asked 20+ times, and not a single answer actually works. In short, the problem is that if you have scrollable content ( overflow: auto; anywhere inside of a draggable jQuery item, when you click and drag the scrollbar's the parent draggable container drags along with it. So, I spent some time working up a solution. Here's an example of some html that would present this problem: <div

Disabling jQuery drag when scrolling contents of draggable item

人盡茶涼 提交于 2019-12-21 02:01:19
问题 I don't normally make this sort of question / answer, but figured I'd do so, since I've seen this question asked 20+ times, and not a single answer actually works. In short, the problem is that if you have scrollable content ( overflow: auto; anywhere inside of a draggable jQuery item, when you click and drag the scrollbar's the parent draggable container drags along with it. So, I spent some time working up a solution. Here's an example of some html that would present this problem: <div

Make a UIView draggable with the finger

蓝咒 提交于 2019-12-21 01:15:06
问题 I have the mainViewController but I have an small UIView inside that is activated when you tap a MKAnnotationView in the MKMapKit , so I need that UIView to be draggable in any part of the screen. An example screenshot of my app: The circle is an example of point, I suppose I can drag for any point of the "small" UIView. I tried using UITapGestureRecognizer but it didn't worked as my code was not good enough and I could not made it draggable because it's only the tap, not tap and move. I hope