<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
ul{
margin: 0;
padding: 0;
list-style: none;
width: 770px;
border: 5px solid #555;
}
ul>li{
border-bottom: 1px double #ccc;
margin: 0;
padding: 0;
overflow: hidden;
}
ul>li>span{
border-right: 1px double #ccc;
float: left;
width: 101px;
margin: 0;
padding: 5px 4px;
}
</style>
<script src="js/jquery.min.js"></script>
</head>
<body>
<ul>
<li><span>ID</span><span>名称</span><span>等级</span><span>金币</span><span>排名</span><span>称号</span><span>战队</span></li>
<li><span>1</span><span>AAA</span><span>30</span><span>6000</span><span>80</span><span>超凡大师</span><span>WE</span></li>
<li><span>1</span><span>AAA</span><span>30</span><span>6000</span><span>80</span><span>超凡大师</span><span>WE</span></li>
<li><span>1</span><span>AAA</span><span>30</span><span>6000</span><span>80</span><span>超凡大师</span><span>WE</span></li>
<li><span>1</span><span>AAA</span><span>30</span><span>6000</span><span>80</span><span>超凡大师</span><span>WE</span></li>
<li><span>1</span><span>AAA</span><span>30</span><span>6000</span><span>80</span><span>超凡大师</span><span>WE</span></li>
<li><span>1</span><span>AAA</span><span>30</span><span>6000</span><span>80</span><span>超凡大师</span><span>WE</span></li>
</ul>
<script>
$('ul>li:not(li:first)').each(function(index,elem){
$(this).on('mouseover',function(){
$(this).css({'background-color':'#cccc','color':'#000000'}).on('mouseleave',function(){
$(this).css({'background-color':'#FFFFFF','color':'#555'})
})
})
})
</script>
</body>
</html>
Jqery实现数据展示
最新推荐文章于 2024-11-05 22:07:06 发布