Firefox浏览器 创建event对象,用来获取鼠标当前坐标

function getEvent(){

  if(document.all){

    return window.event;

  }

  func = getEvent.caller;

  while(func != null){

    var arg0 = func.arguments[0];

    if(arg0){

      if((arg0.constructor == Event || arg0.constructor == MouseEvent) || typeof (arg0) == "object" && arg0.prevebtDefault() && arg0.stopPropagation()){

        return arg0;

      }

    }

    func = func.caller;

  }

  return null;

}

posted on 2019-08-16 12:14  栋H栋  阅读(373)  评论(0编辑  收藏  举报