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

jQuery動畫下劃線跟導航走總結(jié)

original 2018-12-13 16:47:30 294
abstrait:  通過該實例的學習讓我對jQuery動畫有了更新的認識,感覺老是講的這個下劃線跟著導航走有點麻煩,我自己用添加類和刪除類做了一個下劃線跟著導航走的實例,實例如下:<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>下劃線

  通過該實例的學習讓我對jQuery動畫有了更新的認識,感覺老是講的這個下劃線跟著導航走有點麻煩,我自己用添加類和刪除類做了一個下劃線跟著導航走的實例,實例如下:

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>下劃線跟著導航走</title>
<link rel="shortcut iocn" type="image/x-icon" href="../picture/mi.png">
<script type="text/javascript" src="jquery-3.3.1.min.js"></script>
<style type="text/css">
.menu{width: 450px;height: 44px;margin: 0px auto;margin-top: 20px;background-color: #ccc;}
.oneMenu li{float: left;width: 100px;height: 40px;line-height: 40px;text-align: center;/*border-bottom: 4px solid pink;*/list-style: none;margin: 0px auto;cursor: pointer;}
.bt{border-bottom: 4px solid pink;}
</style>
</head>
<body>
<!-- 導航條menu -->
<div>
<ul>
<li>首頁</li>
<li>視頻</li>
<li>新聞</li>
<li>體育</li>
</ul>
</div>
<script type="text/javascript">
$(document).ready(function(){
// 鼠標移上出現(xiàn)下劃線
$('.oneMenu>li').mousemove(function(){
$(this).addClass('bt');
})
// 鼠標離開下劃線消失
$('.oneMenu>li').mouseleave(function(){
$(this).removeClass('bt')
})
})
</script>
</body>
</html>


Professeur correcteur:韋小寶Temps de correction:2018-12-13 17:05:19
Résumé du professeur:寫的很不錯哦!課后記得多練習練習類似的案例哦!

Notes de version

Entrées populaires