当前位置:学会吧培训频道电脑知识学习网页制作Javascript教程javascript-鼠标在焦点时移动位置(兼容FF)» 正文

javascript-鼠标在焦点时移动位置(兼容FF)

[08-08 00:41:31]   来源:http://www.xuehuiba.com  Javascript教程   阅读:8339
概要: window.attachEvent('onunload', function() { _elem.detachEvent('on' + _evtName, f); }); key = null; //f = null; /* DON'T null this out, or we won't be able to detach it */ } else { _elem['on' + _evtName] = _fn; } }, removeEvent: function(_elem, _evtName, _fn, _useCapture) { if (typeof _elem.removeEvent
javascript-鼠标在焦点时移动位置(兼容FF),标签:javascript视频教程,javascript教程下载,http://www.xuehuiba.com
            window.attachEvent('onunload', function()
            {
                _elem.detachEvent('on' + _evtName, f);
            });
       
            key = null;
            //f = null;   /* DON'T null this out, or we won't be able to detach it */
        }
        else
            { _elem['on' + _evtName] = _fn; }
    },   

    removeEvent: function(_elem, _evtName, _fn, _useCapture)
    {
        if (typeof _elem.removeEventListener != 'undefined')
            { _elem.removeEventListener(_evtName, _fn, _useCapture); }
        else if (typeof _elem.detachEvent != 'undefined')
        {
            var key = '{FNKEY::obj_' + xb.ieGetUniqueID(_elem) + '::evt' + _evtName + '::fn_' + _fn + '}';
            var f = xb.evtHash[key];
            if (typeof f != 'undefined')
            {
                _elem.detachEvent('on' + _evtName, f);
                delete xb.evtHash[key];
            }
       
            key = null;
            //f = null;   /* DON'T null this out, or we won't be able to detach it */
        }
    },
   
    mouseEnter: function(_pFn)
    {
        return function(_evt)
        {
            var relTarget = _evt.relatedTarget;               
            if (this == relTarget || xb.isAChildOf(this, relTarget))
                { return; }

            _pFn.call(this, _evt);
        }
    },
   
    isAChildOf: function(_parent, _child)
    {
        if (_parent == _child) { return false };
       
        while (_child && _child != _parent)
            { _child = _child.parentNode; }
       
        return _child == _parent;
    }   
};
/* end */ http://bizhi.knowsky.com/


function addLoadEvent(func){
    var oldonload = window.onload;
    if (typeof window.onload != 'function') {
        window.onload = func;
    } else {
        window.onload = function(){
            oldonload();
            func();
        }
    }
}


function getElementsByClassName(oElm, strTagName, strClassName) {

上一页  [1] [2] [3] [4]  下一页


Tag:Javascript教程javascript视频教程,javascript教程下载电脑知识学习 - 网页制作 - Javascript教程
Copyright 学会吧 All Right Reserved.
在线学习社区!--学会吧
1 2 3 4 5 6 7 7 8 9 10 11 12 13