javascript如何实现点击不同的菜单显示不同的项目
4个回答
展开全部
使用jquery别自己傻傻的做菜单去。通过百度搜索jquery menu。看看把。多百度比在这里提问好
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
s书型吗
<%@ 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 'index.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">
<style type="text/css">
li {
display: none;
}
.tree {
cursor: pointer;
}
</style>
<script type="text/javascript" src="js/jquery-1.6.1.js"></script>
<script type="text/javascript" src="js/jquery.metadata.js"></script>
<script type="text/javascript" src="js/Myjquery.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$(".tree").click(function() {
//alert(99);
var a = $(this).parent();
//alert(a);
a.children("li").toggle();
if ($(this).children().html() == "+") {
$(this).children().html("-");
} else {
$(this).children().html("+");
}
}
);
});
</script>
</head>
<body>
<ul>
<div class="tree">
<span>s+</span>新闻
</div>
<li>
list item 1
</li>
<li>
list item 2
</li>
<li>
list item 3
</li>
<li>
list item 4
</li>
<li>
list item 5
</li>
</ul>
<ul>
<div class="tree">
<span>+</span>影视
</div>
<li>
list item 1
</li>
<li>
list item 2
</li>
<li>
list item 3
</li>
<li>
list item 4
</li>
<li>
list item 5
</li>
</ul>
<form action="">
用户名:
<input type="text" name="userName" />
<button onclick="checkName();">
检查用户手否存在
</button>
</form>
</body>
</html>
<%@ 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 'index.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">
<style type="text/css">
li {
display: none;
}
.tree {
cursor: pointer;
}
</style>
<script type="text/javascript" src="js/jquery-1.6.1.js"></script>
<script type="text/javascript" src="js/jquery.metadata.js"></script>
<script type="text/javascript" src="js/Myjquery.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$(".tree").click(function() {
//alert(99);
var a = $(this).parent();
//alert(a);
a.children("li").toggle();
if ($(this).children().html() == "+") {
$(this).children().html("-");
} else {
$(this).children().html("+");
}
}
);
});
</script>
</head>
<body>
<ul>
<div class="tree">
<span>s+</span>新闻
</div>
<li>
list item 1
</li>
<li>
list item 2
</li>
<li>
list item 3
</li>
<li>
list item 4
</li>
<li>
list item 5
</li>
</ul>
<ul>
<div class="tree">
<span>+</span>影视
</div>
<li>
list item 1
</li>
<li>
list item 2
</li>
<li>
list item 3
</li>
<li>
list item 4
</li>
<li>
list item 5
</li>
</ul>
<form action="">
用户名:
<input type="text" name="userName" />
<button onclick="checkName();">
检查用户手否存在
</button>
</form>
</body>
</html>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
jquery,搜一下,有很多的
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询