mousemove

Jerky horizontal scroll on hover

孤街浪徒 提交于 2019-12-22 00:54:20
问题 I'm using the following JS code to build a horizontal image carousel that scrolls on hover. The mousemove event detects the position of the mouse over the container and scrolls to the left or to the right accordingly. Everything works as I expect but if I move the mouse over the container while the animation is running, it becomes a bit jerky. Is there any solution for this? Thanks JS: $( '.carousel-frame ul' ).mousemove( function(e) { var container = $(this).parent(); if ((e.pageX -

jQuery mousemove performance - throttle events?

好久不见. 提交于 2019-12-21 12:42:50
问题 We are facing a problem with jQuery event propagation performance connected to mousemove: We have a screen filling canvas and need to track if a user drags the mouse on it, so we have added a mouse move listener on that object like this: ourCanvas.on('mousemove', function(event) { event.preventDefault(); //our drag code here } }); This code works fine, but we had severe performance issues in the current Firefox (24) on one test system. The profiler tells us, that most of the time was spent in

jQuery: Fire mousemove events less often

混江龙づ霸主 提交于 2019-12-20 15:23:54
问题 I'm trying to figure out a clean way to aggregate mousemove events so that I ensure my code gets called, but only once every 250-300 milliseconds. I've thought about using something like the following, but was wondering if there was a better pattern, or something jQuery provides that will do the same thing: var mousemove_timeout = null; $('body').mousemove(function() { if (mousemove_timeout == null) { mousemove_timeout = window.setTimeout(myFunction, 250); } }); function myFunction() { /* *

jQuery: Fire mousemove events less often

给你一囗甜甜゛ 提交于 2019-12-20 15:23:25
问题 I'm trying to figure out a clean way to aggregate mousemove events so that I ensure my code gets called, but only once every 250-300 milliseconds. I've thought about using something like the following, but was wondering if there was a better pattern, or something jQuery provides that will do the same thing: var mousemove_timeout = null; $('body').mousemove(function() { if (mousemove_timeout == null) { mousemove_timeout = window.setTimeout(myFunction, 250); } }); function myFunction() { /* *

Move a window by clicking an internal widget instead of title bar

心已入冬 提交于 2019-12-20 07:26:27
问题 In Windows when I create a QMainWindow I can move it around the screen by clicking the title bar and dragging it. In my application I've hidden the title bar by using setWindowFlags(Qt::CustomizeWindowHint) and I'm trying to build a custom title bar using a widget and setting it in the menu space with setMenuWidget(myWidget) . Now I want to reproduce the original behaviour: I want to click on my MyWidget widget inside the QMainWindow and, while mouse is pressed, dragging the mouse moves the

onmouseover fired before click and mouseout events?

依然范特西╮ 提交于 2019-12-20 07:17:54
问题 Unusable links with onmouseover() got an interesting question, when I tried to answer it. After some logging experiments, I've set up http://jsfiddle.net/RnGxP/1/. The last two examples work as expected, the hide when clicking on "Close" or leaving the "Close" div. The first two examples set a new innerHTML to the div whenever the mouse moves in it (I'd never do that myself, but...). So, when moving the mouse into one of them they get expanded. And moving the mouse further on a link or the

pointer motion. why are numbers so high? why does it print info in blocks not a constant stream?

主宰稳场 提交于 2019-12-20 04:43:11
问题 Hi! I am trying to write a program where I need to report the position of every mouse motion. I have called the XSelectInput() function with a PointerMotionMask mask. Everything seems to work alright but the numbers after printing don't appear after every movement, they appear in blocks and also the numbers in event.xmotion.x and event.xmotion.y are very high, in the hundred thousands. What is causing these large numbers? Also is my program getting every number and reporting it immediately or

How to drag a DataPoint and move it in a Chart control

最后都变了- 提交于 2019-12-19 04:02:05
问题 I want to be able to grab a datapoint drawn in a chart and to move it and change its position by dragging it over the chart control. How can I .. ..grab the specific series point (series name ="My Series") When released the series point should change its position/ values It's like making series points movable with drag event. Here the color dots (points) should be able to move: There are some charts like devExpress chart which perform this task but I want to do it in normal MS chart. 回答1:

MouseMove event repeating every second

丶灬走出姿态 提交于 2019-12-18 12:28:45
问题 http://jsfiddle.net/MrkY9/ My computer (and so far, no other computer among my coworkers) is exhibiting an issue in Chrome, IE, and Safari (but not in Firefox). Simple mousemove code, such as the following (already running on the fiddle above) properly catches mousemove events, but then as long as the mouse is in the div, catches a mousemove event every second - even though I'm no longer moving the mouse. var number = 0; $("#foo").on("mousemove", function() { this.innerHTML = number++ });

Global Mouse Moved Events in Cocoa

半城伤御伤魂 提交于 2019-12-18 10:56:20
问题 Is there a way to register for global mouse moved events in Cocoa? I was able to register for the events using Carbon's InstallEventHandler() , but would prefer a Cocoa equivalent. I have looked for NSNotificationCenter events, but there doesn't seem to be any public event names (are there private ones?) Alternatively, is there a way to use NSTrackingArea for views with a clearColor background? The app is Snow Leopard only. 回答1: In SnowLeopard there is a new class method on NSEvent which does