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

導航欄跟隨效果

Original 2018-12-29 14:18:55 410
abstract:<!DOCTYPE html><html><head> <meta charset="utf-8"> <title>導航欄跟隨效果</title> <script type="text/javascript" src="jq.js"></script

<!DOCTYPE html>

<html>

<head>

<meta charset="utf-8">

<title>導航欄跟隨效果</title>

<script type="text/javascript" src="jq.js"></script>

<style type="text/css">

*{margin:0px;padding:0px;list-style:none}

.box{position:relative;}

.head{width:730px;height:30px;margin:auto;background:pink;font-family:'楷體';}

.head ul li{float: left;line-height:30px;text-align:center;margin-left:70px;}

.gen{width:70px;height:3px;background:red;position:absolute;margin-left:368px;margin-top:-3px;}

</style>

<script type="text/javascript">

$(function(){

$('li').hover(

function(){

$x = parseInt($(this).attr('name'))*129

$('.gen').stop().animate({left:$x+'px'},300)

},

function(){

$('.gen').stop().animate({left:'0px'},300)

}

);

})


</script>

</head>

<body>

<div class="box">

<div class="head">

<ul>

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

<li name="1">國際新聞</li>

<li name="2">娛樂天地</li>

<li name="3">科技力量</li>

<li name="4">站點博客</li>

</ul>

</div>

<div class="gen">


</div>

</div>

</body>

</html>

(GEJU`V32L$RB@K45_@8713.png

Correcting teacher:滅絕師太Correction time:2018-12-29 14:31:41
Teacher's summary:完成的不錯,案例可以再寫的好看點奧,前端畢竟要有視覺上美感

Release Notes

Popular Entries