您的位置:首页 > 其它

ul和li导航栏

2016-10-26 16:48 134 查看
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'test3.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<script src="js/jquery-2.1.1.min.js">

</script>
<style>
li{
list-style:none;
color:blue;
font-size:12px;
margin-left:10px;
}
ul{
color:#f1cd23;
font-size:20px;
margin:0px;
padding:1px;
}
p{
width:100px;
height:25px;
background-color:#37dddd;
margin:0px;
padding:0px;
border-radius:5px;
text-align:center;

}
</style>
</head>

<body>
<ul id="ul1">
<p>1111</p>
<li>张三</li>
<li>李四</li>
<li>王五</li>
</ul>
<ul id="ul2">
<p>2222</p>
<li>张三</li>
<li>李四</li>
<li>王五</li>
</ul>
<ul id="ul3">
<p>3333</p>
<li>张三</li>
<li>李四</li>
<li>王五</li>
</ul>
</body>
<script language="JavaScript">
$("p").mousemove(function(){
$(this).parent("ul").find("*").show(500);
var $p=$(this).parent("ul");
var $x=$p.siblings();
$x.find("li").hide(600);

});
$("p").mouseout(function(){
$("ul").find("li").hide(600);
});
</script>
</html>


内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  导航栏 li ul