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

學(xué)到了導(dǎo)航條還可以做成下滑的效果

Original 2019-05-06 14:33:26 286
abstract:<!DOCTYPE html><html><head> <title>下滑線跟隨導(dǎo)航</title> <script type="text/javascript" src="https://code.jquery.com/jquery-3.3.1.min.js"></script&

<!DOCTYPE html>

<html>

<head>

<title>下滑線跟隨導(dǎo)航</title>

<script type="text/javascript" src="https://code.jquery.com/jquery-3.3.1.min.js"></script>

<style type="text/css">

*{margin:0;padding: 0}

ul {list-style: none;;z-index: 20;position: relative;font-size:15px;}

li { float: left; color:#fff; cursor:pointer; font-weight: bold;text-align: center; width:100px; line-height: 30px; }

.menu{width:500px; height: 32px; background: #af3434;border-radius: 3px; position: relative;margin:20px auto; box-shadow:0 2px 20px #000;}

</style>

</head>

<body>


<div class="menu">

<ul>

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

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

<li name="2">獨孤九劍</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>



<script type="text/javascript">

$(function(){

$('li').hover(

function(){

$x= parseInt($(this).attr('name'))*100; //解析一個字符串,返回int值;

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

},

function(){

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

}

)

})

</script>


</body>

</html>


Correcting teacher:查無此人Correction time:2019-05-07 09:48:00
Teacher's summary:完成的不錯。css樣式可以寫到公用文件里,每次直接使用。繼續(xù)加油。

Release Notes

Popular Entries