问题标签 [mouseup]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
1206 浏览

wpf - 在 wpf DataGrid 中使用 MouseUp 事件

我有两个表:请求和项目。此 MouseUp 事件适用于 WinForm DatagridRow。如何将此事件用于 WPF DataGrid?

我在 wpf 中使用它:

CurrentRow 或 CurrentCell 是我的错误点。

0 投票
2 回答
1618 浏览

vb.net - 图片框上的 mouseup 事件

我正在尝试编写一个程序来显示一系列七个图片框(指令、黑色背景、图像、黑色背景等),并且这个系列是由鼠标中键(滚轮)上的 mousedown 事件开始的第一个图片框。对于前四个图片框,该人必须将手指放在方向盘上,并且可能直到第七个。图片框填满屏幕。从盒子到盒子的转换由 winmm.dll 中的 timeGetTime 控制。我很高兴地说,程序的序列部分运行良好。

但是,我有两个问题

  1. 如果中间 mouseup 发生在第五个图片框之前,我需要能够停止此 picBoxes 运行并返回到第一个 picBox。
  2. 我需要记录鼠标向上事件发生在第五个、第六个或第七个框的时间。

然后该人按下鼠标左键或右键,这可以正常工作。一个主要问题似乎是 mouseup 事件不起作用,但是当人们将手指放在左或右键上并让它再次单击时,它会在程序中起作用。

在上一个子程序中的序列之后,我将其分为序列A(picboxes 1-4)和sequenceB(picboxes 5-7)。我放了:

这几天我一直在努力!上面的代码如果有效,只会告诉我鼠标是否在 picBox2 上上升,但我需要知道 picbox 2-4。

0 投票
0 回答
288 浏览

javascript - 当我已经在 mouseover 上拖动时,如何使用 mouseup 触发事件?

我是 jQuery 和 javascript 的新手。

我正在研究一个数字矩形。当用户单击右侧的灰色箭头时,他们可以将矩形拖动到任意数字。左箭头也一样。

我有一个功能,使右箭头永远不能与左箭头在同一位置。

到目前为止,这很好,但用户可以将箭头移动到他们想要的任何地方。我希望这样,如果用户移动箭头,箭头会在矩形上最接近数字的位置。

我在 mouseup 上触发事件,现在我有距离了。即使是这样。例如,如果用户移动右箭头并将其放在 7 和 8 之间,有没有办法将箭头移动到最接近的数字?

这是因为在灰色方块中我放置了左右箭头之间距离的结果。

HTML:

Javascript:

JS Fiddle 中的演示已更新

0 投票
1 回答
251 浏览

jquery - 在没有 mouseup/mousedown 的情况下更改所选元素

假设我在页面上有两个主要元素:一个框和一个项目列表。

我单击了该框并开始拖动鼠标。当光标离开框时,我想将接收鼠标移动的元素更改为列表中的一项,然后在列表上触发 jquery 可排序,而无需释放鼠标并单击它。

我已经尝试过类似的东西......

所以它正在被创建,但它没有开始。任何帮助将不胜感激 :)

0 投票
1 回答
262 浏览

javascript - 关闭 mouseoff 和 mouseup 的功能

我已经在 J​​query 的代码中实现了我自己的滚动,因为当已经涉及 css 动画时,正常滚动不能很好地工作。我想要发生的是当您单击并拖动控制器时,控制器是一个包含股票代码的 div,股票代码移动。当您释放鼠标按钮时,它会停止。那里没问题。问题来了,当我不释放鼠标按钮时,我确实将鼠标从控制器上移开。发生这种情况时 track_mouse_pos 不会停止。当我将鼠标放回正在滚动的控制器上时,是否单击。

我怎样才能关闭('mousemove', track_mouse_pos);?可以只用一个.mouseup.mouseoff线做同样的事情吗?

0 投票
1 回答
1921 浏览

c# - C# windows 窗体 MouseDown 事件未被调用

问题
我创建了一个工具来帮助为游戏创建关卡,当我单击图片框时出现问题,绝对没有任何反应,我放置了一个断点并且它永远不会运行。

图片框事件设置:

http://postimg.org/image/hllv4vwjz/

代码:

自动生成的代码:

请询问任何其他信息

0 投票
1 回答
436 浏览

jquery - How to exclude more div id's from clicking event

I am new to jquery, and i like to know if there is a way to exclude multiple div's from clicking event. First, i was looking how to hide certain div, when mouse clicks outside of it. This is only solution that gave some result (:not selector didn't work). I would like to exclude #cartbasket div as well, so that same button can continue to toggle up and down #cartbasketList ul below. I tried many combinations, but without any good..

html:

CSS:

jquery:

0 投票
1 回答
411 浏览

javascript - Javascript:event.which/button 在 mouseup 上返回错误值

当在 mouseup jQuery 事件上调用 event.button 时,它通常返回 0 左键单击和 2 右键单击​​。

但是,如果按住左键,然后右键单击,event.button 在释放左键后总是返回 2。这使得在两个点击都被释放之前,无法确定哪个点击首先被释放。event.which 也有同样的问题。

有人有解决方法吗?似乎找不到有关此错误的任何报告。

编辑:我知道如何通常确定正在释放哪个键。问题是 mouseup 报告了错误的值。要重现此问题:

按住左键单击。按住右键单击。松开左键。这会触发 mouseup 事件。调用 event.button 期望:0,实际:2

0 投票
1 回答
632 浏览

javascript - 鼠标向上 - 在 Div 外部单击无法在移动设备上运行

在表单外单击时,我使用以下内容隐藏 div 和 ovelay div。

以下javascript是:

这在台式机上运行良好,但在触摸移动设备上却不行。

我猜它与mouseup有关,有什么建议吗?

克雷格。

0 投票
1 回答
323 浏览

javascript - clicking items inside a famo.us scrollview

I have a scrollview with a number of images.

events are working such that the scrollview can be dragged around.

i want to be able to click on a single image to get a detail view so used a:

however, this has the effect that if i click an image when scrolling the above event will also fire.

i guess this is the whole reason mobile browsers have that 300ms delay - to tell if you're clicking or dragging. does Famous have other events to listen for?

In inputs/FastClick.js i only see 'touchstart' 'touchmove' and 'touchend'

do we have to track if a drag motion happened, in our own code, or does the famous engine assist with this?

FWIW i'm using a GenericSync to pipe the events around, and to make the view also work on the desktop.