我用win=new window(....)方式创建一个窗口,如何判断鼠标是否在所创建的窗口上呢?用win.onmouseover没反应,该怎么弄呢?

解决方案 »

  1.   

    我在创建窗口的代码里面这样写:
     this.eventMouseDown = this._initDrag.bindAsEventListener(this);
     this.eventMouseUp   = this._endDrag.bindAsEventListener(this);
     this.eventMouseMove = this._updateDrag.bindAsEventListener(this);
     this.eventMouseOver = this._selfshow.bindAsEventListener(this);
     this.eventMouseOut = this._selfclose.bindAsEventListener(this);
    前面三行的效果可以实现功能,但后面的this.eventMouseOver和this.eventMouseOut在运行的时候却不能够实现所绑定的程序的功能。是啥原因呢,想了好久,想不明白。
      

  2.   

    MouseOut  MouseOver  两个事件应用对象的问题!
    <body onmousemove="func()"> func()就是鼠标在这个窗口上时出现的效果函数(换句话,func()执行了 说明 鼠标在新窗口上)<body onmousemove="this.style.background='red'"> 测试下,通过!