jquery顶部固定二级导航菜单

本文详细介绍了如何利用jQuery来创建一个在页面滚动时始终保持在顶部的二级导航菜单。内容包括导航的HTML结构设置、CSS样式布局以及jQuery代码实现,确保导航在用户滚动页面时依然可见。
摘要由CSDN通过智能技术生成
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title></title>
</head>
<style type="text/css">
body{
	font-family: "宋体";
	font-size: 14px;
	color: #666666;
	background:#f2f2f2 url(images/bg.gif) repeat-x left top;
	height: 2000px;
}

ul,li,html,body{margin: 0px; padding: 0px;}
ul{list-style-type: none;}
a:link,a:visited{
	text-decoration: none;
	color: #666;
}

#top_bg{
	position: fixed;
	width: 100%;
	height: 40px;
	background:#333;
	border-bottom: 1px solid #c6c6c6
	box-shadow: 2px 5px 7px #999;
	z-index: 999;
	left: 0px;
}
.top{
	margin: 0px auto;
	width: 980px;
	height: 40px;
}
.logo_l{
	float: left;
	width: 145px;
	height: 40px;
	background:url(images/logo.png) no-repeat left;
}
.nav_r{
	width: auto !important;
	height: 40px;
	float: left;
	position: relative;
	z-index: 999;
}

#navul li{
	position: relative;
	float: left;
	width: 80px;
	height: 40px;
	line-heig
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值