JQuery左边滑出导航

Original 2019-05-14 20:29:32 258
abstract:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <script src="http://code.jquery.com/jquery-3.4.1.min.js">
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<script src="http://code.jquery.com/jquery-3.4.1.min.js"></script>
<link href="//netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<title>JQuery左边滑出导航</title>
<style>
*{margin: 0;padding: 0;}
ul{list-style: none;position: fixed;top: 10px;left: 0px;}
#nav li{width: 80px;height: 80px;margin: 10px 0px;border-top-right-radius: 10px;border-bottom-right-radius: 10px;
line-height: 80px;text-align: center;}
.li1{background: rgba(11, 216, 165, 0.5);}
.li2{background: rgba(224,121,121, 0.5);}
.li3{background: rgba(216, 31, 108, 0.5);}
.li4{background: rgba(216, 197, 31, 0.836);}
.li5{background: rgba(151, 216, 31, 0.5);}
#nav li span{font-weight: 700;font-size: 30px;color: #fff;}
</style>
<script>
$(document).ready(function(){
$('#nav li').stop().animate({'marginLeft':'-65px'},1000);
$('li').hover(function(){
$(this).stop().animate({'marginLeft':'-2px'},500);
},function(){
$(this).stop().animate({'marginLeft':'-65px'},500);
});
});
</script>
</head>
<body>
<ul id="nav">
<li class="li1"><span class="fa fa-tags"></span></li>
<li class="li2"><span class="fa fa-address-card"></span></li>
<li class="li3"><span class="fa fa-grav"></span></li>
<li class="li4"><span class="fa fa-user-o"></span></li>
<li class="li5"><span class="fa fa-handshake-o"></span></li>
</ul>
</body>
</html>


Correcting teacher:天蓬老师Correction time:2019-05-15 13:32:19
Teacher's summary:划出导航, 一个好实用的功能 , 配个图片更好

Release Notes

Popular Entries