jquerymenu

<%@ 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 'jquerymenu.jsp' starting page</title>

    <style type="text/css">

.fathermenu {

margin-left: 60px;

}

 

.submenu {

margin-left: 40px;

}

 

.submenu li{

background-color:gray;

line-height: 20px;

margin-top:1px;

width:80px;

}

</style>

<script type="text/javascript" src="Script/jquery.js"></script>

<script language="javascript" type="text/javascript"> 

$(document).ready(function () {

//页面加载时,二级菜单全部隐藏

$(".submenu").css("display","none");

$("li").css("list-style","none");

$(".fathermenu").toggle(function () {

$(this).next(".submenu").css("display", "block");

},function(){

$(this).next(".submenu").css("display", "none");

})

}) 

</script>

</head>

<div class="main"> 

<div class="fathermenu"> 

<img src="images/yuan.gif" /><span class="admintext11">服务管理</span>

</div> 

<div class="submenu"> 

<ul> 

<li><a href='http://www.baidu.com' target="_blank">  baidu</a></li> 

<li><a href='#' title=''>  等待发布</a></li> 

<li><a href='#' title=''>  正式项目</a></li> 

<li><a href='#' title=''>  点此新增</a></li>

</ul> 

</div> 

 

<div class="fathermenu"> 

<img src="images/yuan.gif" /><span class="admintext11">FAQ管理</span>

</div> 

<div class="submenu"> 

<ul> 

<li><a href='#'>  等待提交</a></li> 

<li><a href='#' title=''>  等待发布</a></li> 

<li><a href='#' title=''>  正式项目</a></li> 

<li><a href='#' title=''>  点此新增</a></li>

</ul> 

</div> 

</div> 

</body>

你可能感兴趣的:(juery)