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

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

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

    基于JS代碼實(shí)現(xiàn)當(dāng)鼠標(biāo)懸停表格上顯示這一格的全部?jī)?nèi)容
    來(lái)源:易賢網(wǎng) 閱讀:2384 次 日期:2016-06-20 12:04:32
    溫馨提示:易賢網(wǎng)小編為您整理了“基于JS代碼實(shí)現(xiàn)當(dāng)鼠標(biāo)懸停表格上顯示這一格的全部?jī)?nèi)容”,方便廣大網(wǎng)友查閱!

    想實(shí)現(xiàn)這樣一個(gè)功能,就是在一個(gè)表格中,由于很多字過(guò)多,所以用文字溢出的方法處理了,但是這樣就無(wú)法看到表格中具體的內(nèi)容呢。想實(shí)現(xiàn)當(dāng)鼠標(biāo)移上去的時(shí)候可以顯示這一行被隱藏的內(nèi)容。當(dāng)然這個(gè)網(wǎng)上有很多插件,但是我沒(méi)有用,還是自己寫(xiě)了一個(gè)。

    css部分

    <style>

    #showbox {

    width: 150px;

    min-height: 50px;

    font: 100 14px/1 "微軟雅黑";

    border: 1px solid #3c8dbc;

    display: none;

    position: absolute;

    top: 0;

    left: 0;

    background-color: #fff;

    padding: 5px;

    }

    </style>

    html部分

    <table id="example1" role="grid">

    <thead style="background-color: #E4E9F0;">

    <tr role="row">

    <th rowspan="2" style="text-align: center; width: 6%;" class="sorting_disabled " colspan="1"><font style="font-weight:bold;">序號(hào)</font></th>

    <th rowspan="2" style="text-align: center; width: 10%;" class="sorting_disabled " colspan="1"><font style="font-weight:bold;">名稱</font></th>

    <th rowspan="2" style="text-align: center; width: 10%;" class="sorting_disabled " colspan="1"><font style="font-weight:bold;">類(lèi)別</font></th>

    <th rowspan="2" style="text-align: center; width: 8%;" class="sorting_disabled" colspan="1"><font style="font-weight:bold;">單位</font></th>

    <th rowspan="2" style="text-align: center; width: 26%;" class="sorting_disabled " colspan="1"><font style="font-weight:bold;">成果要求</font></th>

    <th colspan="2" style="text-align: center; " rowspan="1"><font style="font-weight:bold;">進(jìn)展</font></th></tr>

    <tr role="row">

    <th style="text-align: center; width: 30%;" class="sorting_disabled" rowspan="1" colspan="1"><font style="font-weight:bold;">最新進(jìn)展</font></th>

    <th style="text-align: center; width: 10%;" class="sorting_disabled " rowspan="1" colspan="1"><font style="font-weight:bold;">更新時(shí)間</font></th></tr>

    </thead>

    <tbody>

    <tr role="row">

    <td>1</td>

    <td>阿拉蕾</td>

    <td>阿拉蕾</td>

    <td>阿拉蕾</td>

    <td>阿拉蕾</td>

    <td>阿拉蕾</td>

    <td></td>

    </tr>

    <tr role="row">

    <td>2</td>

    <td>阿拉蕾</td>

    <td>阿拉蕾</td>

    <td>阿拉蕾</td>

    <td>阿拉蕾</td>

    <td>阿拉蕾</td>

    <td></td>

    </tr>

    <tr role="row" class="odd">

    <td>3</td>

    <td>阿拉蕾</td>

    <td>阿拉蕾</td>

    <td>阿拉蕾,</td>

    <td>阿拉蕾</td>

    <td></td>

    </tr>

    </tbody>

    </table>

    <div id="showbox"></div>

    js部分

    $(function() {

    function showBox(obj,box){

    var timer = null;

    $(obj).on("mouseover", function (e) {

    clearTimeout(timer);

    var clientX = e.clientX;

    var clientY = e.clientY;

    var txt = $(this).text();

    timer = setTimeout(function () {

    console.log(clientX, clientY);

    $(box).css("left", clientX).css("top", clientY);

    if (txt == "") {

    $(box).hide();

    } else {

    $(box).show();

    $(box).html(txt);

    }

    }, 1000);

    });

    $(obj).on("mouseout",function(){

    clearTimeout(timer);

    $(box).hide();

    });

    }

    showBox("#example1 > tbody td","#showbox");

    });

    最后,其實(shí)bootstrap里面有個(gè)組建可以顯示里面的內(nèi)容,只是顯示的是title,一開(kāi)始不會(huì)改沒(méi)用那個(gè),后經(jīng)人點(diǎn)醒,可以直接給title賦值,就是給title賦值為表格里面的text就好。

    以上所述是小編給大家介紹的基于JS代碼實(shí)現(xiàn)當(dāng)鼠標(biāo)懸停表格上顯示這一格的全部?jī)?nèi)容,希望對(duì)大家有所幫助

    更多信息請(qǐng)查看網(wǎng)絡(luò)編程
    由于各方面情況的不斷調(diào)整與變化,易賢網(wǎng)提供的所有考試信息和咨詢回復(fù)僅供參考,敬請(qǐng)考生以權(quán)威部門(mén)公布的正式信息和咨詢?yōu)闇?zhǔn)!

    2026上岸·考公考編培訓(xùn)報(bào)班

    • 報(bào)班類(lèi)型
    • 姓名
    • 手機(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)