欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

jQuery實現(xiàn)二級導(dǎo)航菜單的示例

 更新時間:2020年09月30日 15:33:24   作者:申霖  
這篇文章主要介紹了jQuery實現(xiàn)二級導(dǎo)航菜單的示例,幫助大家理解和制作網(wǎng)頁特效,感興趣的朋友可以了解下

實用JQ實現(xiàn)導(dǎo)航二級菜單效果,導(dǎo)航菜單在網(wǎng)站中非常常見,有的網(wǎng)站可能會出現(xiàn)三級菜單及多級菜單模式,下面我們來簡單的實現(xiàn)一個二級菜單的效果。

部分效果截圖:

整體代碼:

<!DOCTYPE html>  
<html>  
	<head>  
		<meta charset="UTF-8">  
		<title>導(dǎo)航菜單案例</title>  
		<style>  
			*{  
				padding: 0;  
				margin: 0;  
			}  
			ul,li{  
				list-style: none;  
			}  
			a{  
				text-decoration: none;  
			}  
			nav{  
				width: 1140px;  
				height: 40px;  
				margin: 0 auto;  
				border:solid 1px #CCC;  
				position: relative;	
  
			}  
			nav ul li{  
				width: 150px;  
				line-height: 40px;  
				float: left;  
			}  
			nav ul li a{  
				display: block;  
				width: 100%;  
				float: left;  
				color: #444;  
				font-size: 14px;  
				text-align: center;  
			}  
			nav>ul>li:hover{  
				background: #f5f5f5;  
			}  
			nav ul li ul{  
				display: none;  
				width: 150px;  
				position: absolute;  
				background-color: #f5f5f5;  
				overflow: hidden;  
				top:41px;  
			}  
			nav ul li ul li{  
				float: left;  
				border-bottom: solid 1px #CCC;  
			}  
			nav ul li ul li:last-child{  
				border: none;  
			}  
			nav>ul>li>ul>li:hover a{  
				background-color: #444;  
				color: #FFF;  
			}  
		</style>  
	</head>  
	<body>  
		<br />  
		<br />  
		<nav>  
			<ul>  
				<li><a href="" title=" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" 首頁">首頁</a></li>  
				<li><a href="" title=" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" 聯(lián)系我們">聯(lián)系我們</a></li>  
				<li><a href="" title=" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" 在線留言">在線留言</a></li>  
				<li>  
					<a href="" title=" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" 新聞資訊">新聞資訊</a>  
					<ul>  
						<li><a href="" title=" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" 國內(nèi)資訊">國內(nèi)資訊</a></li>  
						<li><a href="" title=" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" 國內(nèi)資訊">國內(nèi)資訊</a></li>  
					</ul>  
				</li>  
				<li>  
					<a href="" title=" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" 產(chǎn)品中心">產(chǎn)品中心</a>  
					<ul>  
						<li><a href="" title=" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" 除雪機">除雪機</a></li>  
						<li><a href="" title=" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" 運雪車">運雪車</a></li>  
					</ul>  
				</li>  
				<li><a href="" title=" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" 案例展示">案例展示</a></li>  
			</ul>  
		</nav>  
		<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>  
		<script>  
			var $li = $("nav > ul > li");  
	   	$li.mouseenter(function () {  
		$(this).children("ul").stop().slideDown();  
    	});  
    	$li.mouseleave(function () {  
     		$(this).children("ul").stop().slideUp();  
     	});	
  
		</script>  
	</body>  
</html>

以上就是jQuery實現(xiàn)二級導(dǎo)航菜單的示例的詳細內(nèi)容,更多關(guān)于jQuery實現(xiàn)二級導(dǎo)航菜單的資料請關(guān)注腳本之家其它相關(guān)文章!

相關(guān)文章

最新評論