茄子在线看片免费人成视频,午夜福利精品a在线观看,国产高清自产拍在线观看,久久综合久久狠狠综合

    <s id="ddbnn"></s>
  • <sub id="ddbnn"><ol id="ddbnn"></ol></sub>

  • <legend id="ddbnn"></legend><s id="ddbnn"></s>

    javascript實現(xiàn)鼠標移出事件onmouseout
    來源:易賢網(wǎng) 閱讀:1978 次 日期:2015-04-22 11:06:50
    溫馨提示:易賢網(wǎng)小編為您整理了“javascript實現(xiàn)鼠標移出事件onmouseout”,方便廣大網(wǎng)友查閱!

    最近在做一個簡單的鼠標onmouseover時顯示層(層里面有多個鏈接文字),onmouseout 時隱藏層的功能時,發(fā)現(xiàn)有諸多問題,onmouseout 發(fā)現(xiàn)它的觸發(fā)太敏感,當經(jīng)過層內(nèi)文字鏈時,即觸發(fā)onmousetout事件,功能不能正常顯示,經(jīng)過一番搜索,整理出來,供大家參考。

    1、

    <script type="text/javascript">

    function test(obj, e) {if (e.currentTarget) { if (e.relatedTarget != obj) { if (obj != e.relatedTarget.parentNode) { alert(1); } }} else { if (e.toElement != obj) { if (obj != e.toElement.parentNode) { alert(1); } }}} </script><div onmouseout="test(this, event)" style="width:100px;height:100px;border:1px #666 solid"><span style="margin:5px;width:100%;height:100%;border:1px #ff0000 solid">faddsf</span></div> 2、

    var LeaveFunext = function(t,f){for(var p in f){t[p]=f[p]} return t};

    var IE = '\v' == 'v';

    var contains = function(wrap,child){

    if(IE) return wrap.contains(child);

    while(child && typeof(child.parentNode) != "undefind"){

    if(wrap == child) return true;

    child = child.parentNode;

    }

    return false;

    };

    var LeaveFun = function(o){

    var _o = typeof o =="string" ? document.getElementById(o) : o;

    return this == window ? new LeaveFun(_o):LeaveFunext(_o, LeaveFun.prototype);

    };

    LeaveFun.prototype = {

    mouseleave : function(fn){

    if(IE){

    this.attachEvent('onmouseleave',fn);

    }else{

    this.addEventListener('mouseout',function(e){

    tar = e.relatedTarget;

    if(!contains(this, tar)){

    fn.call(this);

    }

    }, false);

    }

    return this;

    }

    };

    //調(diào)用

    LeaveFun('share_customerdiv').mouseleave(function(){document.getElementById('share_customerdiv').style.display ='none';})

    3、最簡單,但在部分系統(tǒng)上會有輕微閃爍。 <div style="z-index: 11; " onmouseout="this.style.display='none'" onmouseover="this.style.display='block'" >

    <b class="STYLE19">更多此人的...</b>

    <a class="STYLE8" >留言板</a>

    <a class="STYLE8" >好友</a>

    <a class="STYLE8"></a>

    </div>

    更多信息請查看IT技術(shù)專欄

    更多信息請查看腳本欄目
    易賢網(wǎng)手機網(wǎng)站地址:javascript實現(xiàn)鼠標移出事件onmouseout

    2026國考·省考課程試聽報名

    • 報班類型
    • 姓名
    • 手機號
    • 驗證碼
    關于我們 | 聯(lián)系我們 | 人才招聘 | 網(wǎng)站聲明 | 網(wǎng)站幫助 | 非正式的簡要咨詢 | 簡要咨詢須知 | 新媒體/短視頻平臺 | 手機站點 | 投訴建議
    工業(yè)和信息化部備案號:滇ICP備2023014141號-1 云南省教育廳備案號:云教ICP備0901021 滇公網(wǎng)安備53010202001879號 人力資源服務許可證:(云)人服證字(2023)第0102001523號
    聯(lián)系電話:0871-65099533/13759567129 獲取招聘考試信息及咨詢關注公眾號:hfpxwx
    咨詢QQ:1093837350(9:00—18:00)版權(quán)所有:易賢網(wǎng)