支持的呀,如果是事件的话event ,事件函数的第一个参数是event,第二个是target

解决方案 »

  1.   

    (function (bool) {
    //兼容FF一些方法
        
        if (bool) {
            
            window.__defineGetter__("event", function () {
            //兼容Event对象
                var o = arguments.callee;
                do {
                    if (o.arguments[0] instanceof Event) return o.arguments[0];
                } while (o = o.caller);
                return null;
            });
            
            Event.prototype.__defineGetter__("srcElement", function () {
            //兼容Event.srcElement对象
                var n = this.target;
                while (n.nodeType != 1) n = n.parentNode;
                return n;
            });
            
        }})(/Firefox/.test(window.navigator.userAgent));var e = window.event;
    if ((e.keyCode || e.which) == 40) {
    }
      

  2.   


    (function (bool) {
    //兼容FF一些方法
        
        if (bool) {
            
            window.__defineGetter__("event", function () {
            //兼容Event对象
                var o = arguments.callee;
                do {
                    if (o.arguments[0] instanceof Event) return o.arguments[0];
                } while (o = o.caller);
                return null;
            });
            
            Event.prototype.__defineGetter__("srcElement", function () {
            //兼容Event.srcElement对象
                var n = this.target;
                while (n.nodeType != 1) n = n.parentNode;
                return n;
            });
            
        }})(/Firefox/.test(window.navigator.userAgent));var e = window.event;
    if ((e.keyCode || e.which) == 40) {
    }
      

  3.   

    你这写的怎么调用啊,比如事件触发后可用相关的函数 if(event.keyCode == 40)
    {
        last();
    }
      

  4.   

    前面这段是在FF里获取event对象<script type="text/javascript">
    (function (bool) {
    //兼容FF一些方法
        
        if (bool) {
            
            window.__defineGetter__("event", function () {
            //兼容Event对象
                var o = arguments.callee;
                do {
                    if (o.arguments[0] instanceof Event) return o.arguments[0];
                } while (o = o.caller);
                return null;
            });
            
        }})(/Firefox/.test(window.navigator.userAgent));document.onkeydown = function () {
    var e = window.event;
    alert(e.keyCode || e.which); //其实FF2.0已经支持keyCode方法了
    };
    </script>