内容说明
效果: 页面中有导航栏,当页面滚动超出一定范围时,它会固定在设置好的位置,一般是固定在顶部。
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>jQuery实现在鼠标滚动后导航栏保持固定</title>
<style>
* {
padding: 0;
margin: 0
}
ul, li {
list-style: none;
}
a {
text-decoration: none;
color: #333;
}
.content {
width: 1200px;
margin: auto;
}
.menu {
line-height: 60px;
height: 60px;