午夜国产狂喷潮在线观看|国产AⅤ精品一区二区久久|中文字幕AV中文字幕|国产看片高清在线

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

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

    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、最簡(jiǎn)單,但在部分系統(tǒng)上會(huì)有輕微閃爍。 <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>

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

    更多信息請(qǐng)查看腳本欄目
    易賢網(wǎng)手機(jī)網(wǎng)站地址:javascript實(shí)現(xiàn)鼠標(biāo)移出事件onmouseout
    由于各方面情況的不斷調(diào)整與變化,易賢網(wǎng)提供的所有考試信息和咨詢回復(fù)僅供參考,敬請(qǐng)考生以權(quán)威部門(mén)公布的正式信息和咨詢?yōu)闇?zhǔn)!

    2025國(guó)考·省考課程試聽(tīng)報(bào)名

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