枚举_JavaScript类中的所有属性 / 方法

1、这里的 “this.MouseMove” 是类里面的方法,这个函数在 鼠标移动时 被调用。

  如下的代码,即可枚举出 类"[object MouseEvent]"的所有属性 / 方法

    this.MouseMove = function(_event)
    {
        for (z in _event)
        {
            console.log(z+" --> "+_event[z]);
        }
    };

 

2、

3、

4、

5、

 

posted @ 2017-09-28 16:20  Html5Skill  阅读(435)  评论(0编辑  收藏  举报