document.onmousemove = moveGuides;function moveGuides(e) {
    if (!guidesState) { return false; };
    e = window.event ? window.event : e;
    dollar("guidesYLine").style.left = browserIsIE ? (e.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft)) + guidesSkew + "px" : e.pageX + guidesSkew + "px";
    dollar("guidesXLine").style.top = browserIsIE ? (e.clientY + (document.documentElement.scrollTop || document.body.scrollTop)) + guidesSkew + "px" : e.pageY + guidesSkew + "px";
}我的问题就是document.onmousemove = moveGuides这里调用moveGuides函数为什么不用传递参数啊???moveGuides函数里面的参数 e 又是代表什么东西啊???有的时候执行的时候会告诉我说 e 未定义。

解决方案 »

  1.   

    e是一个对象。
    e = window.event ? window.event : e;//这条语句就看得出来了
    你如果按照上面的方法使用。应该不会告诉你e未定义才对。顶多就是可能你在获取e的某些属性的时候,当前的对象不具备这个属性,倒是会
      

  2.   

    我可能把document.onmousemove 写成了一个iframe下的document如下:
     document.getElementById('mainiframe').contentWindow.document我认为既然是一个页面鼠标移动的事件,我可不可以改成是在某个iframe下的鼠标移动的事件,这样去做的,然后就报错了
      

  3.   

    在本页面中如何获取iframe里面的鼠标滚动事件????document.onmousemove是页面上的,在iframe上不好使啊!!!!!!!
      

  4.   

    事件写去iframe中。如果父窗口需要获取值,则iframe中传过来就是了