onmousemove

Simple pure Javascript drag controller slider

 ̄綄美尐妖づ 提交于 2019-12-03 07:36:55
问题 Hi Developers all over the world. I would like to have some help with a simple, pure Javascript (30 lines) , JQuery free (and other library's) drag control slider. I have been searching months and found many scripts but i don't like -Jquery cause most script need 4, 5, 6 javascript includes.. I prefer smaller and basic script.. i like to ajust them like i want and i also can lean alot from smaller scripts. All i need is a simple slider that i can use for: rescale images, scroll page, change

Move a PictureBox with mouse

允我心安 提交于 2019-12-01 00:31:19
I'm developing an app for windows mobile (Compact Framework 2.0). It has a WinForms with a PictureBox. I want to move the image of the PictureBox but I don't know how to do it so I choose to move the hole PictureBox. To do it I use this event: private void imagenMapa_MouseMove(object sender, MouseEventArgs e) { imagenMapa.Left = e.X; imagenMapa.Top = e.Y; this.Refresh(); } But when I move the PictureBox it blinks and moves every where. What I'm doing wrong? The e.X and e.Y are relative to the picture box (e.g. if the mouse is in the upper left of the picture box, that's 0,0) . The values for

How do I feed values to the statusStrip from a form control?

让人想犯罪 __ 提交于 2019-11-29 16:26:02
This is the context of my controls: /* Form StatusStrip ToolStripStatusLabel TableLayoutPanel MyGenioView */ So, MyGenioView is intercepting the MouseMove event handler. The code that is already there is for a rubber band rectangle. So I have: public void MyMouseMove(Object sender, MouseEventArgs e) { Point ptCurrent = new Point(e.X, e.Y); // If we "have the mouse", then we draw our lines. if (m_bHaveMouse) { // If we have drawn previously, draw again in // that spot to remove the lines. if (m_ptLast.X != -1) { MyDrawReversibleRectangle(m_ptOriginal, m_ptLast); } // Update last point. m_ptLast

Mouse cursor not changing if a pointer is not moved in Webkit-based browsers

五迷三道 提交于 2019-11-29 13:24:40
Let's assume that we have simple jQuery code like the following: var $document = $(document); $document.ready(function() { var $test = $("#test"); $document.keydown(function(e) { e.shiftKey && $test.css("cursor", "pointer"); }); }); The problem is that WebKit does not change the #test block mouse cursor if the mouse pointer is moved over the #test block, and the Shift key is pressed then. But as soon as you move the cursor, Chrome and Safari change the cursor style to pointer - exactly as it's expected but without mouse move. This bug (?) is not relevant to Firefox, and I didn't check it under

How to determine the direction on onmousemove event?

萝らか妹 提交于 2019-11-29 08:15:07
问题 On some condition I want to cancel onmousemove event when mouse goes down, for example. Is it possible to determine the direction of onmousemove event? jQ or JS is Ok. I have drag’n’drop elements. The user drags the elenment up. If, for example, the bottom of the element reaches some position in the document (i.e. 500px from the top of the document) the onmousemove stops. And if the user will try to drag the element up again the function will not start. Only drag down will be possible for

How do I feed values to the statusStrip from a form control?

旧街凉风 提交于 2019-11-28 10:48:24
问题 This is the context of my controls: /* Form StatusStrip ToolStripStatusLabel TableLayoutPanel MyGenioView */ So, MyGenioView is intercepting the MouseMove event handler. The code that is already there is for a rubber band rectangle. So I have: public void MyMouseMove(Object sender, MouseEventArgs e) { Point ptCurrent = new Point(e.X, e.Y); // If we "have the mouse", then we draw our lines. if (m_bHaveMouse) { // If we have drawn previously, draw again in // that spot to remove the lines. if

Mouse cursor not changing if a pointer is not moved in Webkit-based browsers

有些话、适合烂在心里 提交于 2019-11-28 07:20:49
问题 Let's assume that we have simple jQuery code like the following: var $document = $(document); $document.ready(function() { var $test = $("#test"); $document.keydown(function(e) { e.shiftKey && $test.css("cursor", "pointer"); }); }); The problem is that WebKit does not change the #test block mouse cursor if the mouse pointer is moved over the #test block, and the Shift key is pressed then. But as soon as you move the cursor, Chrome and Safari change the cursor style to pointer - exactly as it

onMouseMove get mouse position

空扰寡人 提交于 2019-11-27 02:03:53
In javascript, within the javascript event hander for onMouseMove how do I get the mouse position in x, y corrdinates relative to the top of the page? if you can use jQuery, then this will help: <div id="divA" style="width:100px;height:100px;clear:both;"></div> <span></span><span></span> <script> $("#divA").mousemove(function(e){ var pageCoords = "( " + e.pageX + ", " + e.pageY + " )"; var clientCoords = "( " + e.clientX + ", " + e.clientY + " )"; $("span:first").text("( e.pageX, e.pageY ) - " + pageCoords); $("span:last").text("( e.clientX, e.clientY ) - " + clientCoords); }); </script> here

clearRect function doesn&#39;t clear the canvas

喜你入骨 提交于 2019-11-26 13:47:15
I'm using this script on the body onmousemove function: function lineDraw() { // Get the context and the canvas: var canvas = document.getElementById("myCanvas"); var context = canvas.getContext("2d"); // Clear the last canvas context.clearRect(0, 0, canvas.width, canvas.height); // Draw the line: context.moveTo(0, 0); context.lineTo(event.clientX, event.clientY); context.stroke(); } It's supposed to clear the canvas each time I move the mouse around, and draw a new line, but it isn't working properly. I'm trying to solve it without using jQuery, mouse listeners or similar. Here is a demo:

onMouseMove get mouse position [duplicate]

北慕城南 提交于 2019-11-26 09:52:57
问题 This question already has answers here : How to get mouse position in jQuery without mouse-events? (6 answers) Closed last month . In Javascript, within the Javascript event handler for onMouseMove how do I get the mouse position in x, y coordinates relative to the top of the page? 回答1: if you can use jQuery, then this will help: <div id="divA" style="width:100px;height:100px;clear:both;"></div> <span></span><span></span> <script> $("#divA").mousemove(function(e){ var pageCoords = "( " + e