drag

Resizing Handles on a Rotated Element

一笑奈何 提交于 2019-12-12 07:56:02
问题 I'm trying to put resizing handles on the four corners of a rectangle, which can be dragged to resize the rectangle. What I'm having trouble with is calculating the new width, new height, and new points of the rectangle after I've dragged one of the rectangle's points. If the rectangle were not rotated, this would obviously be very easy because the width and height would change by the same amout as the mouse's offsetX and offsetY. However, this rectangle CAN be rotated, so offsetX and offsetY

Drag while in background in KineticJs

佐手、 提交于 2019-12-12 05:49:17
问题 I have two layers generally representing a large background and some content on top of it. I have made the background draggable but when dragged, it covers the content of the other layer. Is it possible to keep it in the background while dragging it? I have tried binding the drag events with .moveToBottom() for the background group (later added to backgroundLayer) like that: groupBackground.on('dragstart',function(){ groupBackground.moveToBottom(); }); groupBackground.on('dragmove',function()

WP7 slider strange behavior

夙愿已清 提交于 2019-12-12 05:39:14
问题 I'm developing Windows Phone 7 app. I have slider control on several page. However, when I go to a certain page within my app, all my slider controls in every page behave strangely. The symptom is that user can only drag the thumb on slider for very short range. The certain page I mentioned has no problem with code and XAML. Why does it cause ALL sliders to behave wrongly ? 回答1: The problem is that using toolkit Gesture will cause Slider to behave strangely. So when start manipulating on

How to move map under a marker? android

非 Y 不嫁゛ 提交于 2019-12-12 05:25:02
问题 I want to implement the drag effect of a map. When we drag the map the marker should show the current position or latitude and longitude. Its done in Uber application see below: In this marker shows the current location as the map is dragged. How can I achieve this??? ChooseFromMapActivity public class ChooseFromMapActivity extends AppCompatActivity implements GoogleMap.OnCameraChangeListener { TextView textShowAddress; private GoogleMap mMap; LatLng latLng; double latitude = 17.385044;

Xamarin Imageview Drag Sample

泄露秘密 提交于 2019-12-12 04:35:12
问题 (Xamarin with Visual Studio 2015 ) I want to implement a simple Activity inwith an Imageview, which can be moved/dragged with touch: This is what I have implemented, but the Image is flickering and moving slower. Can you give me an example how to implement this? Thanks for your help! private void TouchMeImageViewOnTouch(object sender, View.TouchEventArgs touchEventArgs) { View bild = (View)sender; RelativeLayout.LayoutParams layouti = (RelativeLayout.LayoutParams)bild.LayoutParameters; switch

How to resize parent by dragging one of it's children?

徘徊边缘 提交于 2019-12-12 04:14:16
问题 Essentially i want to resize the green box by dragging the blue thing. I'm trying to use OffsetLeft but is not working. also the drag event doesn't fire in Firefox. And i have the code here: jsbin link <div id="parent"> <div draggable="true" id="child" ondrag="dragging(event)" ></div> </div> <script> const parent = document.getElementById('parent'); const child = document.getElementById('child'); function dragging(event) { console.log("dragging"); parent.style.width = child.offsetLeft; } <

raphael js drag rotation in Firefox and Internet Explorer

ぃ、小莉子 提交于 2019-12-12 04:05:43
问题 I am new to the SVG and Raphael world and am trying to create a radial dial that has a draggable needle. The drag works fine in Chrome, Safari, and Opera. In Internet Explorer the movement is very jittery and and will often return to it's initial starting position. In Firefox, it doesn't work at all :( var paper = Raphael("paper1", 250, 250); var dialCenter = 125; var dialRadius = 125; var dialCircum = 2 * Math.PI * dialRadius; var circle = paper.circle(dialCenter, dialCenter, dialRadius)

Improving JavaScript Dragging Effect

老子叫甜甜 提交于 2019-12-12 03:22:25
问题 I have managed to implement a simple JavaScript dragging effect to create "panel windows" inside a webpage, in which I can drag the object from any corner or position. I have only used the onmousedown (to indicate a possible dragging), onmousemove (to perform dragging) and onmouseup (to stop dragging) events. It works well except when I drag the object too near an edge and move the mouse even at a normal speed. When I move the mouse towards an area outside the object, the dragging fails until

Resize the content in div with the drag

寵の児 提交于 2019-12-12 03:19:57
问题 I am trying to drag and resize the div layer. And i am able to do that perfectly. But the issue is i am unable to apply resize effect to the content in the div. I tried applying same to the img element directly and it allows me to drag the element around but doesn't let me resize it. http://jsfiddle.net/MwV8g/1/ 回答1: There you go: http://jsfiddle.net/MwV8g/18/ 来源: https://stackoverflow.com/questions/9307362/resize-the-content-in-div-with-the-drag

How to animate an object vertically with touch like Spotify's music player does when tapping the song,

≡放荡痞女 提交于 2019-12-12 02:16:52
问题 Im using Xcode, and when i tap/drag on my imageView at the bottom of the screen, I want it to be brought up and reveal all of it on screen similiar to the way Spotify does it when you click the banner at the bottom. Any ideas? 回答1: I recommend using spring animations if you want a nice animation like this: func buttonTapped(sender: UIButton!) { //or in an IBAction let duration: NSTimeInterval = 0.75 let damping: CGFloat = 1 let velocity: CGFloat = 0.5 UIView.animateWithDuration(duration,