亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

為什么attr可以獲得屬性值正常輸出,但css不行望解答

original 2019-01-24 18:39:37 310
abstrait:<!DOCTYPE html><html><head><meta charset="utf-8" /><meta http-equiv="X-UA-Compatible" content="IE=edge"><title>Page Title</title>

<!DOCTYPE html>

<html>

<head>

<meta charset="utf-8" />

<meta http-equiv="X-UA-Compatible" content="IE=edge">

<title>Page Title</title>

</head>

<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>

<style>

*{

padding:0;

margin:0;

}

ul{

list-style: none;

z-index:20;

position: relative;

font-size: 15px;

}

li{

float: left;

cursor: pointer;

width: 100px;

height: 30px;

text-align: center;

line-height: 30px;

color: #fff;

font-weight: bold;

}

.menu{

width: 500px;

position: relative;

margin: 20px auto;

height: 32px;

box-shadow: 0 2px 20px #000;

background: #AF3434;

border-radius: 3px;

}

</style>

<script>


</script>

<body>

<div class="menu">

<ul>

<li name="0">首頁</li>

<li name="1">php中文網(wǎng)</li>

<li name="2">獨(dú)孤九劍</li>

<li name="3">西門大官人</li>

<li name=4>滅絕師太</li>

</ul>

<div class="block" style="z-index:10;width:100px;height:2px;background:#fff;position:absolute;top:30px;"></div>

</div>

</body>

</html>

<script>

$(function(){

$('li').hover(function(){

$('li').hover(

function(){

$x = parseInt($(this).attr('name'));//為什么不能用css來獲取值

$('.block').stop().animate({left:100*$x+'px'},300);

},

function(){

$('.block').stop().animate({left:'0px'},200);

}

)

})

})

</script>


Professeur correcteur:韋小寶Temps de correction:2019-01-25 09:12:13
Résumé du professeur:都是正常的啊 css不也是正常的嗎?哪里有問題?。?

Notes de version

Entrées populaires