精华内容
下载资源
问答
  • MouseEvent

    2021-01-11 06:11:01
    <div><p>https://developer.mozilla.org/en/docs/Web/API/MouseEvent </p><p>该提问来源于开源项目:Fyrd/caniuse</p></div>
  • mouseEvent

    2019-09-20 05:03:53
    dom event 被触发,对应的函数中会包含一个默认的event对象,个个内核的浏览器中的event对象不尽相同,简单的列一下mouseEvent中几个主流浏览器共有重要的属性; clienX,clienY 鼠标触发点在DOM中的xy...

    dom event 被触发,对应的函数中会包含一个默认的event对象,个个内核的浏览器中的event对象不尽相同,简单的列一下mouseEvent中几个主流浏览器共有重要的属性;

     

    clienX,clienY 鼠标触发点在DOM中的xy坐标
    layerX,layerY  
    offsetX,offsetY  
    pageX,pageY  
    screenX,screenY  
    x,y  
       
    type 就是你的鼠标事件的名称了,如:click;blur;focus;mouseOver.....
       

     

    转载于:https://my.oschina.net/u/3304551/blog/1082861

    展开全文
  • mouseEvent-源码

    2021-02-17 11:43:15
    mouseEvent
  • MouseEvent-源码

    2021-02-13 07:11:23
    MouseEvent
  • mouseEvent兼容IE

    千次阅读 2018-07-04 18:02:23
    (function (window) { try { new MouseEvent('test'); return false; // No need to polyfill } catch (e) { // Need to polyfill - fal...
    (function (window) {
                try {
                    new MouseEvent('test');
                    return false; // No need to polyfill
                } catch (e) {
                    // Need to polyfill - fall through
                }
    
                // Polyfills DOM4 MouseEvent
    
                var MouseEvent = function (eventType, params) {
                    params = params || { bubbles: false, cancelable: false };
                    var mouseEvent = document.createEvent('MouseEvent');
                    mouseEvent.initMouseEvent(eventType, params.bubbles, params.cancelable, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
    
                    return mouseEvent;
                }
    
                MouseEvent.prototype = Event.prototype;
    
                window.MouseEvent = MouseEvent;
            })(window);


    展开全文
  • mouseevent tips

    2013-11-19 20:27:00
    全文如下: ...在MouseEvent中,ROLL_OVER和MOUSE_OVER、ROLL_OUT和MOUSE_OUT是两对比较相似的事件,它们有什么区别呢?AS3语言参考中是这样解释的: rollOver 事件的目的是简化带有子级的显示对...

    关于roll_over 和 mouse_over的区别,这篇文章说明的很清楚,http://zengrong.net/post/1105.htm

    全文如下:

    在MouseEvent中,ROLL_OVER和MOUSE_OVER、ROLL_OUT和MOUSE_OUT是两对比较相似的事件,它们有什么区别呢?AS3语言参考中是这样解释的:

     

    rollOver 事件的目的是简化带有子级的显示对象容器的移开行为的编码。当鼠标进入某个显示对象区域或者从其子级以外的对象进入任何其子级区域时,该显示对象将分派 rollOver 事件。这种行为与 mouseOver 事件的行为不同,每次鼠标进入显示对象容器的任何子对象区域时都会分派此事件,即使鼠标已在显示对象容器的另一个子对象上也是如此。

    解释得有些拗口,实际上简单说就是:ROLL_OVER事件无视子对象,只监听根对象的事件。

    看了下面演示,就更清楚了。

    源码:

     
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    
    package
    {
    	import flash.display.Sprite;
    	import flash.events.MouseEvent;
    	import flash.text.TextField;
     
    	[SWF(width=350,height=400)]
    	public class SimpleSample9 extends Sprite
    	{
    		private var _spriteChild:Sprite;
    		private var _spriteParent:Sprite;
    		private var _tf:TextField;
    		private var _line:int=0;
     
    		public function SimpleSample9()
    		{
    			_spriteChild = new Sprite();
    			_spriteChild.name = 'child';
    			_spriteChild.graphics.beginFill(0x81ADF0);
    			_spriteChild.graphics.drawCircle(0, 0, 40);
    			_spriteChild.graphics.endFill();
     
    			_spriteParent = new Sprite();
    			_spriteParent.name = 'parent';
    			_spriteParent.graphics.beginFill(0x0000ff);
    			_spriteParent.graphics.drawCircle(0,0, 90);
    			_spriteParent.graphics.endFill();
     
    			_spriteParent.addChild(_spriteChild);
    			addChild(_spriteParent);
    			_spriteParent.x = stage.stageWidth/2;
    			_spriteParent.y = _spriteParent.height/2;
     
    			_tf = new TextField();
    			_tf.border = true;
    			_tf.width = stage.stageWidth;
    			_tf.height = stage.stageHeight-_spriteParent.y-_spriteParent.height/2;
    			_tf.y = stage.stageHeight - _tf.height;
    			addChild(_tf);
     
    			_spriteParent.addEventListener(MouseEvent.MOUSE_OVER, mouseHandler);
    			_spriteParent.addEventListener(MouseEvent.MOUSE_OUT, mouseHandler);
    			_spriteParent.addEventListener(MouseEvent.ROLL_OVER, mouseHandler);
    			_spriteParent.addEventListener(MouseEvent.ROLL_OUT, mouseHandler);	
    		}
     
    		private function mouseHandler(evt:MouseEvent):void
    		{
    			_line++;
    			var __ctName:String = evt.currentTarget.name;
    			var __tName:String = evt.target.name;
    			var __rName:String = evt.relatedObject == null ? 'null' : evt.relatedObject.name;
    			_tf.text = _line.toString()+','+(evt.type+',currentTarget:'+__ctName+',target:'+__tName+',relatedObject:'+__rName+'\n') + _tf.text;
    		}
    	}
    }

     

     

    我自己的一点理解:

    当鼠标在 大圆parent的范围内 移到 小圆child中 时,

    大圆parent抛出mouse_out事件,小圆childe抛出mouse_over事件,而小圆抛出的事件通过冒泡又被大圆截获到!

    大圆抛出的mouse_out事件的relatedObject的值是child

    小圆抛出的mouse_over时间的relatedObject的值是parent

     

    而如果只监听了roll_over事件时,当鼠标在 在 大圆parent的范围内 移到 小圆child中 时,是没有事件抛出的。

     

    roll_over比mouse_over先抛出

    mouse_out又比roll_out先抛出

     

     

     

    转载于:https://www.cnblogs.com/tianlanliao/p/3430257.html

    展开全文
  • Java鼠标事件MouseEvent

    2014-06-20 16:36:07
    当在一个组件上按下,释放,点击,移动或拖动鼠标时就会产生鼠标事件。MouseEvent对象捕获这个事件.
  • Flex MouseEvent

    千次阅读 2011-11-08 11:00:58
    <![CDATA[ import mx.controls.*; import mx.containers.*; import mx.events.*;... import flash.events.MouseEvent; import flash.display.Sprite; public function abin():void {
     
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
    
    
      <mx:Script>
      	<![CDATA[
      	import mx.controls.*;
      	import mx.containers.*;
      	import mx.events.*;
      	import flash.events.MouseEvent;
      	import flash.display.Sprite;
    
      	public function abin():void
      	{
      	    ie.addEventListener(MouseEvent.CLICK,select);
      	   // this.buttonMode = true;
             ie.addEventListener(MouseEvent.CLICK, clickHandler);
             ic.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownListener);
             ip.addEventListener(MouseEvent.MOUSE_UP, mouseUpListener);
           //  addEventListener(MouseEvent.CLICK, clickHandler);
             ib.addEventListener(MouseEvent.DOUBLE_CLICK, doubleClickHandler);
            i2.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
            i3.addEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
            i4.addEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
            i5.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
            i6.addEventListener(MouseEvent.MOUSE_WHEEL, mouseWheelHandler);
    
      	}
      	
      	  private function clickHandler(event:MouseEvent):void {
             Alert.show("中国");
          }
          function mouseDownListener(event:MouseEvent):void {
            Alert.show("美国");
          }
          function mouseUpListener(event:MouseEvent):void {
            Alert.show("德国");
          }
          function doubleClickHandler(event:MouseEvent):void {
            Alert.show("双击");
          }
           private function draw(w:uint, h:uint, bgColor:uint):void {
            graphics.clear();
            graphics.beginFill(bgColor);
            graphics.drawRect(0, 0, w, h);
            graphics.endFill();
        }
    
          private function mouseDownHandler(event:MouseEvent):void {
            trace("mouseDownHandler");
           // draw(overSize, overSize, downColor);
             Alert.show("双击down");
            var sprite:Sprite = Sprite(event.target);
            sprite.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
            sprite.startDrag();
        }
    
        private function mouseMoveHandler(event:MouseEvent):void {
            trace("mouseMoveHandler");
            event.updateAfterEvent();
        }
    
        private function mouseOutHandler(event:MouseEvent):void {
            trace("mouseOutHandler");
            Alert.show("双击out");
           // draw(size, size, backgroundColor);
        }
    
        private function mouseOverHandler(event:MouseEvent):void {
            trace("mouseOverHandler");
            Alert.show("双击over");
           // draw(overSize, overSize, overColor);
        }
    
        private function mouseWheelHandler(event:MouseEvent):void {
        	Alert.show("双击wheel");
            trace("mouseWheelHandler delta: " + event.delta);
        }
    
        private function mouseUpHandler(event:MouseEvent):void {
            trace("mouseUpHandler");
            var sprite:Sprite = Sprite(event.target);
            sprite.removeEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
            sprite.stopDrag();
            Alert.show("双击up");
           // draw(overSize, overSize, overColor);
        }
    
      		 public function select( ):void
      		{
      			//id.visible=false;
      			Alert.show("hello");
      		}
      	]]>
      </mx:Script>
    	<mx:Panel width="682" height="494" layout="absolute">
    		<mx:RadioButton x="152" y="227" label="label" id="ie" click="select()"  labelPlacement="left" buttonMode="true"/>
    		<mx:Button x="310" y="227" label="Button" buttonMode="true" click="clickHandler(event)" id="bt"/>
    		<mx:CheckBox x="152" y="310" label="Checkbox" id="ic" click="mouseDownListener(event)" buttonMode="true"/>
    		<mx:PopUpButton x="310" y="310" label="mouseUpListener" id="ip" click="mouseUpListener(event)" buttonMode="true"/>
    		<mx:Button x="10" y="360" label="doubleClickHandler" id="ib" doubleClick="doubleClickHandler(event)" doubleClickEnabled="true"/>
    		<mx:Button x="21" y="40" label="mouseDownHandler" id="i2" click="mouseDownHandler(event)"/>
    		<mx:Button x="188" y="40" label="mouseOutHandler" id="i3" click="mouseOutHandler(event)"/>
    		<mx:Button x="505" y="40" label="mouseUpHandler" id="i5" click="mouseUpHandler(event)"/>
    		<mx:Button x="347" y="40" label="mouseOverHandler" id="i4" click="mouseOverHandler(event)"/>
    		<mx:Button x="17" y="153" label="mouseWheelHandler" id="i6" click="mouseWheelHandler(event)"/>
    		<mx:Button x="372" y="405" label="19" id="i9"/>
    		<mx:Button x="164" y="405" label="17" id="i7"/>
    		<mx:Button x="241" y="405" label="18" id="i8"/>
    	</mx:Panel>
    </mx:Application>

    展开全文
  • 鼠标事件 mouseEvent 这个是有兼容性的问题的,还是低版本IE不支持 e.pageX 返回鼠标相对于文档页面的X坐标,会跟随页面的滚动而获得新坐标,就是在浏览器窗口大小没有变化的前提下,滚动了页面,就算是相同的...
  • (global as any).MouseEvent as MouseEvent; ({ selector: 'ngx-charts-force-directed-graph', </code></pre> <p>common/area-tooltip.component.ts <pre><code>typescript // tslint:disable-next-...
  • 鼠标事件-MouseEvent

    千次阅读 2018-08-31 18:32:47
      当鼠标进行某种操作时,就会生成...可以通过如下方法在google控制台打印出 MouseEvent 对象。 function mouseDown(e){  var e = e||event;  console.log(e) } window.onload = function (){   document.g...
  • Maybe we can also catch <code>touchstart</code> and <code>touchend</code> and make them same as mouseEvent so we can play hanabi on iPad. <p>I've found part of code of this function, and it's...
  • 目录 | contents 一、相关接口 与鼠标相关的顶层接口有两个:MouseListener和...public void mousePressed (MouseEvent event ) public void mouseClicked (MouseEvent event ) public void mous...
  • m comparing <a href="https://html.spec.whatwg.org/multipage/scripting.html#hit-regions">the spec</a> for the <code>region</code> property for <code>MouseEvent</code> and <code>Touch</code> and there ...
  • <div><p>The off-click uses MouseEvent which is an object from the global window. Angular2-modules should avoid direct access to window to be compatible with Angular-Universal and WebWorker. <p>When I ...
  • mouse_event简介所有组件都能发出鼠标事件,MouseEvent类负责捕获鼠标事件,可以通过为组件添加实现了MouseListener接口的监听器类来处理相应的鼠标事件。MouseListener接口共有5个抽象方法,分别在光标移入或移出...
  • https://stackoverflow.com/questions/36845515/mouseevent-path-equivalent-in-firefox-safari</p> <p>for two possible/working solutions.</p><p>该提问来源于开源项目:manzinello/mailgo</p></div>
  • JAVA MouseEvent实现纪要Jre1.7鼠标事件以MouseEvent类封装。共有如下8种:/***The"mouseclicked"event.ThisMouseEvent*occurswhenamousebuttonispressedandreleased.*/publicstaticfinalintMOUSE_CLICKED=MOUSE_...
  • mouseEntered(MouseEvent e) 鼠标移入组件 mouseExited(MouseEvent e) 鼠标移出组件 mousePressed(MouseEvent e) 鼠标按下 mouseReleased(MouseEvent e) 鼠标松开 完整代码演示 监听器类MouseListe...
  • Java MouseEvent类鼠标事件详解

    千次阅读 2020-05-04 10:41:51
    简介 所有组件都能发出鼠标事件,MouseEvent类负责捕获鼠标事件,可以通过为组件添加实现了MouseListener接口的监听器类来处理相应的鼠标事件。 MouseListener接口共...
  • <div><p>The DOM idlharness test would not run as <code>MouseEvent</code>/<code>MouseEventInit</code> were not declared within any IDL files parsed. Add these in as untested IDLs.</p><p>该提问来源于...
  • mouseEvent之前还有几个小事件 5.submit,reset: 只针对表单form,表单里的东西不针对 这里面有个属性e.preventDefault取消事件默认行为。 6.resize和scroll: 针对窗口调整大小。也就是针对window 首先了解一个...
  • 第11章:MouseEvent

    2019-01-28 10:44:35
    1,MouseEvent鼠标事件处理 2,源码: #ifndef MAINWINDOW_H #define MAINWINDOW_H #include &lt;QMouseEvent&gt; #include &lt;QLabel&gt; #include &lt;QMainWindow&gt; namespace Ui {...
  • MouseEvent接口指用户与指针设备( 如鼠标 )交互时发生的事件。使用此接口的常见事件包括:click,dblclick,mouseup,mousedown。 MouseEvent()--生成一个新的MouseEvent对象。 -------------------------...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 4,527
精华内容 1,810
关键字:

mouseevent