亚洲天堂av网站在线看_国产成人性生交大片免费_欧美18videosex69_午夜精品理伦果冻传媒

歡迎來到億搜云建站平臺,全網(wǎng)營銷云系統(tǒng)加盟中心!

海量企業(yè)網(wǎng)站模板 · 任您選擇

美出特色,精出品質(zhì),一切為了企業(yè)更好的營銷

隱藏側(cè)欄
Beta
轉(zhuǎn)載

table鼠標懸停效果

       懸停     2016-03-01     eycms     215     0    

table 鼠標懸停效果

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title></title>

<style type="text/css">

    table{width:100%;background-color:#fff;}

    table td{background-color:#ccc;padding:5px;}

    table tr.hover td{background-color:Green;}

</style>

</head>

<body>

<div id="container">

</div>

<script type="text/javascript">


    var doc = document,

        container = doc.getElementById("container"),

        html = [],

        table, i, len;

        

    var addListener = function () {

        if (window.addEventListener) {

            return function (el, sType, fn, capture) {

                el.addEventListener(sType, fn, (capture));

            };

        } else if (window.attachEvent) {

            return function (el, sType, fn, capture) {

                el.attachEvent("on" + sType, fn);

            };

        } else {

            return function () { };

        }

    } ();


    html[html.length] = '<table id="tablelist" cellpadding="0" cellspacing="1" border="0">';

    for (i = 0, len = 1000; i < len; i += 1) {

        html.push("<tr><td>1</td><td>2</td><td>3</td><td>1</td><td>2</td><td>3</td><td>1</td><td>2</td><td>3</td><td>1</td><td>2</td><td>3</td><td>1</td><td>2</td><td>3</td></tr>");

    }

    html[html.length] = "</table>";

    container.innerHTML = html.join('');


    

    table = doc.getElementById("tablelist");


addListener(table, "mouseover", function (e) {

e = e || window.event;

var elem = e.target || e.srcElement,

name = elem.nodeName;

if(name === "TD"){

elem = elem.parentNode;

name = elem.nodeName;

}

setTimeout(function(){

if(name === "TR"&&elem.className.indexOf('h')<0){

elem.className = "hover";

}

},0);

});

addListener(table, "mouseout", function (e) {

e = e || window.event;

var elem = e.target || e.srcElement,

name = elem.nodeName;

if(name === "TD"){

elem = elem.parentNode;

name = elem.nodeName;

}

setTimeout(function(){

if(name === "TR"&&elem.className.indexOf('h')>=0){

elem.className = "";

}

},0);


});

    /*for (i = 0, len = table.rows.length; i < len; i += 1) {

        (function(item){

            addListener(item, "mouseover", function () {

                item.className = "hover";

            });

            addListener(item, "mouseout", function () {

                item.className = "";

            });

        })(table.rows[i]);

    }*/

</script>

</body>

</html>


--結(jié)束END--

本文鏈接: http://m.qdqldq.com/resources/hover/1537.html (轉(zhuǎn)載時請注明來源鏈接)

 
本文標簽: 全部

下班PC閱讀不方便?

手機也可以隨時學習開發(fā)

微信關(guān)注公眾號“億搜云”
"億搜云平臺前端開發(fā)教學"
每日干貨技術(shù)分享
 

×

成為 億搜云平臺 代理商!

關(guān)注

微信
關(guān)注

微信掃一掃
獲取最新優(yōu)惠信息

億搜云平臺公眾號

客服

聯(lián)系
客服

很高興為您服務(wù)
尊敬的用戶,歡迎您咨詢,我們?yōu)樾掠脩魷蕚淞藘?yōu)惠好禮。 咨詢客服

聯(lián)系客服:

在線QQ: 40819446

客服電話: 15250286283

售前咨詢 售后服務(wù)
在線交談 智能小云

工作時間:

周一至周五: 09:00 - 17:00

WAP

手機
訪問

移動端訪問
手機上也能選模板

億搜云平臺手機端