drag

Two divs 50% each. Make middle draggable to make bigger or smaller

戏子无情 提交于 2019-12-05 07:01:59
问题 Alright everyone, is there a way to have 2 divs taking up 50% of the screen and have a bar in the middle so you can drag it and make the left 40% and the right 60% and vice versa. I hope to be able to do this jquery. 回答1: Here's a method which I quickly wrote, this does not use jQuery though. <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Example Slider</title> <style type="text/css"> #bar1 { position: absolute; background: red; height: 250px; width: 400px; z-index: 1; } #bar2 {

Mousedown on body and drag the page up or down, like on a pdf

久未见 提交于 2019-12-05 05:55:59
问题 How would I make it so I can mousedown on the body on my page, then drag the page up or down, like you can in a PDF? Basically I want to be able to drag the whole page up and down, any idea how to do this? I don't want to use jQuery UI for anything. 回答1: Okay, here are the stages... 1) You need to have a constant listener on the body of the document that will keep tabs on the current mouse position 2) On mouse down you will need to scroll roughly equal to the mouse movement (you could choose

UIimages move to the center when going to another view

泪湿孤枕 提交于 2019-12-05 04:10:47
问题 I have a drag n drop kind of app. Where you can select images and drag them anywhere on the screen! The problem I'm running into is, when you move to another view, all the images reset to the center, when I return back. For example if I press a button to take me to screen 2, all the "dragged" images I just did, will move back to the center. This only happens when I have AUTOLAYOUT enabled :( I have all my images start out in the center, so I'm guessing its something with autolayout... Any

Mouse click and drag Event WPF

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-04 23:42:55
I am developing an analog clock picker control. The user is able to click on the minute or hour hand and drag to turn the needle to select the specific time. I was wondering how to detect such a click and drag event. I tried using MouseLeftButtonDown + MouseMove but I cannot get it to work as MouseMove is always trigger when the mousemove happen despite me using a flag. Is there any easier way? public bool dragAction = false; private void minuteHand_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { dragAction = true; minuteHand_MouseMove(this.minuteHand, e); } private void

Android: How to drag(move) PopupWindow?

早过忘川 提交于 2019-12-04 22:11:09
问题 I want to be able to move PopupWindow on touch dragging. I don't want UI to update on the release of the touch. I want PopupWindow to follow my touch. This is something what I am doing: mView = mLayoutInflater.inflate(R.layout.popup, null); mPopupWindow = new PopupWindow(mView, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, false); mPopupWindow.showAtLocation(parentView, Gravity.CENTER, -5, 30); mView.setOnTouchListener(new OnTouchListener() { private int dx = 0; private int dy = 0;

How can I only run an AJAX call on change when the mouse (or finger) is no longer dragging?

落花浮王杯 提交于 2019-12-04 18:12:18
I have series of interactive sliders that change calculated values. The calculations run on every tiny move of a dragged handle (via mousedown or touch drag event). I need to update a database with the values but would prefer only to grab the values after the user "drops" the handle. How can I determine if a finger or mouse is down, in order to skip the AJAX call? function handleIsBeingDragged() { // calculations based on all the input values here // pseudo-code to check for mouseup event if (mouseUp) { // save only if mouse is now up - to avoid hundreds of updates per drag event $.ajax(); } }

android drag view smooth

限于喜欢 提交于 2019-12-04 16:28:24
问题 I have to drag some views on screen. I am modifying their position by changing left and top of their layout parameters from motion event on ACTION_MOVE from touch listener. Is there a way to "drag" items more smooth? Because tis kind of "dragging" is no smooth at all... Here is the code public boolean onTouch(View view, MotionEvent motionEvent) { switch (motionEvent.getAction()) { case MotionEvent.ACTION_DOWN: dx = (int) motionEvent.getX(); dy = (int) motionEvent.getY(); break; case

How to make a pattern “fixed” in Raphael.js / IE?

心已入冬 提交于 2019-12-04 15:05:44
问题 I'm creating a small tool to illustrate the benefits of polarizing lenses. Basically a user will drag the lenses (a Raphael.js path) over a dazzling scene (the CSS background of the container DIV) and "see through" the lenses. Here is the js code: var rsr = Raphael("playmask", 720,540); // Lens path var path_f = rsr.path("M0,73.293c0.024-39.605,17.289-53.697,35.302-61.34C53.315,4.312,99.052-0.012,119.011,0 c38.56,0.021,43.239,11.164,43.229,29.9c-0.002,3.45-0.76,28.632-16.349,58.949c-10.332,20

How to hold and drag (re-position) a layout along with its associated layouts in android

做~自己de王妃 提交于 2019-12-04 12:24:51
问题 I am making an android app. In which I have a scenario. First watch screen shot below so any one come here to answer has some clear picture that what I want. Scenario: Activity having map below navigation bar, a RelativeLayout (Red background) in center, a ListView below Red RelativeLayout What I want: I want to drag or re-position (whatever the term may be used by others) Red RelativeLayout by holding my finger on it and move up and down on the screen along with listview below should also

Drag scrolling in a GTK+ app

瘦欲@ 提交于 2019-12-04 08:03:29
I am working on a GTK+ application that uses goocanvas to display a graph on screen. I am having problems coming up with a good way to implement drag scrolling. Currently the app saves the coordinates where the user clicked and then in a "motion-notify" signal callback, does goo_canvas_scroll_to() to the new position. The problem is that drawing is somewhat slow, and with each pixel moved by the mouse, I get the callback invoked once. This makes the drawing lag behind when dragging the graph around. Is there a good way to do drag scrolling, so it'd appear more smooth and I could skip some of