java--css+js做的树形菜单(完整版)

jsp页面:

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
 String path = request.getContextPath();
 String basePath = request.getScheme() + "://"
   + request.getServerName() + ":" + request.getServerPort()
   + path + "/";
%>
<html>
 <link rel="stylesheet" type="text/css" href="<%=basePath%>css/menu.css">
 <head>
  <title>树形菜单</title>
 </head>
<body class="panel" topmargin="0" leftmargin="0">
<div id="body" style="width: 186px">
  <!-- 树形结构菜单  -->
  <ul id="menu">
   <!-- levelOne 一 -->
   <li class="L1">
   <a href="javascript:c(OneLevelOne01);" id="OneLevelOne01">
   <span><img src="<%=basePath%>images/jia.png" id="OneLevelOne01Image" align="absMiddle"/> 客户关系管理系统</span>
   </a>
   </li>
   <ul id="OneLevelOne01d" style="display: none;" class="U1">
        <!-- levelTwo -->
        <li class="L21">
        <a href="javascript:c(OneLevelTwo01);" id="OneLevelTwo01">
	    <span><img src="<%=basePath%>images/jia.png"  align="absMiddle" id="OneLevelTwo01Image"/> 文件管理</span>
	    </a>
	    </li>
        <ul id="OneLevelTwo01d" style="display: none;">
            <!-- levelThree -->
            <li class="L3"><a href="fileList.action" target="mainRight">
		    <span><img src="<%=basePath%>images/jian.png"  align="absMiddle"/> 文件列表</span>
		    </a>
		    </li>
		    <!-- levelThree -->
            <li class="L3"><a href="toUploadJsp.action" target="mainRight">
		    <span><img src="<%=basePath%>images/jian.png"  align="absMiddle" /> 文件上传</span>
		    </a>
		    </li>
        </ul>
        <!-- levelTwo -->
        <li class="L21">
        <a href="javascript:c(OneLevelTwo02);" id="OneLevelTwo02">
		<span><img src="<%=basePath%>images/jia.png"  align="absMiddle" id="OneLevelTwo02Image" /> 111111</span>
		</a>
		</li>
        <ul id="OneLevelTwo02d" style="display: none;">
             <!-- levelThree -->
             <li class="L3"><a href="" target="mainRight">
			 <span><img src="<%=basePath%>images/jian.png"  align="absMiddle" /> 000001</span>
			 </a>
			 </li>
			 <!-- levelThree -->
             <li class="L3"><a href="" target="mainRight">
			 <span><img src="<%=basePath%>images/jian.png"  align="absMiddle" /> 000002</span>
			 </a>
			 </li>
			 <!-- levelThree -->
             <li class="L3"><a href="" target="mainRight">
			 <span><img src="<%=basePath%>images/jian.png"  align="absMiddle" /> 000003</span>
			 </a>
			 </li>
			 <!-- levelThree -->
             <li class="L3"><a href="" target="mainRight">
			 <span><img src="<%=basePath%>images/jian.png"  align="absMiddle" /> 000004</span>
			 </a>
			 </li>
			 <!-- levelThree -->
             <li class="L3"><a href="" target="mainRight">
			 <span><img src="<%=basePath%>images/jian.png"  align="absMiddle" /> 000005</span>
			 </a>
			 </li>
        </ul>
   </ul>
   <!-- levelOne:账号管理  -->
   <li class="L1">
   <a href="javascript:c(TwoLevelOne02);" id="TwoLevelOne02">
   <span><img src="<%=basePath%>images/jia.png" id="TwoLevelOne02Image" align="absMiddle"/> 账号管理</span>
   </a>
   </li>
   <ul id="TwoLevelOne02d" style="display: none;" class="U1">
        <!-- levelTwo: -->
        <li class="L21">
        <a href="#" target="right">
	    <span><img src="<%=basePath%>images/jian.png" align="absMiddle" />修改密码</span>
	    </a>
	    </li>
	    <%if(session.getAttribute("user.type").toString().equals("1")){%>
        <!-- levelTwo -->
        <li class="L21">
        <a href="toAdminMain" target="right">
	    <span><img src="<%=basePath%>images/jian.png" align="absMiddle" />用户管理</span>
	    </a>
	    </li>
	    <%}%>
        <!-- levelTwo  -->
        <li class="L21">
        <a href="#" onclick=top.location.replace("Quit")>
		<span><img  src="<%=basePath%>images/jian.png"  align="absMiddle" />退出系统</span>
		</a>
		</li>
   </ul>
</ul>
</div>
<div id="bottom"></div>
<script type="text/javascript" src="<%=basePath%>js/menu.js"></script>
</body>
</html>

css文件:/css/menu.css

{
 PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px
}
HTML {
 OVERFLOW-Y: scroll
}
A:link {
 COLOR: #000000; TEXT-DECORATION: none
}
A:visited {
 COLOR: #000000; TEXT-DECORATION: none
}
A:active {
 COLOR: #3333ff; TEXT-DECORATION: none
}
A:hover {
 COLOR: #ff0000; TEXT-DECORATION: none
}
.panel {
 BACKGROUND: #d6e4ef; COLOR: #000000
}
#expand_link {
 FONT-SIZE: 9pt; LEFT: 140px; POSITION: absolute; TOP: 11px; TEXT-DECORATION: underline
}
UL {
 PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px; list-style-type:none; url("../images/toright.png");
}
IMG {
 BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; WIDTH: 16px; BORDER-BOTTOM: 0px; HEIGHT: 16px;
}
#body {
 BORDER-RIGHT: #ffffff 0px solid; PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: #ffffff; PADDING-BOTTOM: 0px; BORDER-LEFT: #ffffff 0px solid; WIDTH: 100%; PADDING-TOP: 25px
}
#menu {
 BORDER-RIGHT: #246191 0px solid; BORDER-TOP: #246191 0px solid; BACKGROUND: #ffffff; BORDER-LEFT: #246191 0px solid; BORDER-BOTTOM: medium none
}
.U1 {
 BACKGROUND: #ffffff; BORDER-BOTTOM: #ffffff 1px solid
}
.L1 A:link {
 DISPLAY: block; FONT-SIZE: 9pt; BACKGROUND: url(../images/img/menu1_bg.png); COLOR: #476074; HEIGHT: 24px; TEXT-DECORATION: none
}
.L1 A:visited {
 DISPLAY: block; FONT-SIZE: 9pt; BACKGROUND: url(../images/img/menu1_bg.png); COLOR: #476074; HEIGHT: 24px; TEXT-DECORATION: none
}
.L1 A:link SPAN {
 PADDING-RIGHT: 0px; PADDING-LEFT: 16px; BACKGROUND: url(../images/ico/ar1.png) no-repeat left 50%; PADDING-BOTTOM: 0px; VERTICAL-ALIGN: middle; WIDTH: 100%; CURSOR: hand; PADDING-TOP: 7px; HEIGHT: 24px
}
.L1 A:visited SPAN {
 PADDING-RIGHT: 0px; PADDING-LEFT: 16px; BACKGROUND: url(../images/ico/ar1.png) no-repeat left 50%; PADDING-BOTTOM: 0px; VERTICAL-ALIGN: middle; WIDTH: 100%; CURSOR: hand; PADDING-TOP: 7px; HEIGHT: 24px
}
.L1 A:hover {
 FONT-WEIGHT: bold; BACKGROUND: url(../images/img/menu1_bg.png) 0px -24px; COLOR: #000000
}
.L1 A.active:link {
 BACKGROUND: url(../images/img/menu1_bg.png) 0px -24px
}
.L1 A.active:hover {
 BACKGROUND: url(../images/img/menu1_bg.png) 0px -24px
}
.L1 A.active:active {
 BACKGROUND: url(../images/img/menu1_bg.png) 0px -24px
}
.L1 A.active:visited {
 BACKGROUND: url(../images/img/menu1_bg.png) 0px -24px
}
.L1 A.active:link SPAN {
 FONT-WEIGHT: bold; BACKGROUND: url(../images/ico/ad1.png) no-repeat left 50%; COLOR: #000000
}
.L1 A.active:hover SPAN {
 FONT-WEIGHT: bold; BACKGROUND: url(../images/ico/ad1.png) no-repeat left 50%; COLOR: #000000
}
.L1 A.active:active SPAN {
 FONT-WEIGHT: bold; BACKGROUND: url(../images/ico/ad1.png) no-repeat left 50%; COLOR: #000000
}
.L1 A.active:visited SPAN {
 FONT-WEIGHT: bold; BACKGROUND: url(../images/ico/ad1.png) no-repeat left 50%; COLOR: #000000
}
.L21 A:link {
 DISPLAY: block; PADDING-LEFT: 13px; FONT-SIZE: 9pt; BACKGROUND: none transparent scroll repeat 0% 0%; COLOR: #444659; HEIGHT: 24px; TEXT-DECORATION: none
}
.L21 A:visited {
 DISPLAY: block; PADDING-LEFT: 13px; FONT-SIZE: 9pt; BACKGROUND: none transparent scroll repeat 0% 0%; COLOR: #444659; HEIGHT: 24px; TEXT-DECORATION: none
}
.L22 A:link {
 DISPLAY: block; PADDING-LEFT: 13px; FONT-SIZE: 9pt; BACKGROUND: none transparent scroll repeat 0% 0%; COLOR: #444659; HEIGHT: 24px; TEXT-DECORATION: none
}
.L22 A:visited {
 DISPLAY: block; PADDING-LEFT: 13px; FONT-SIZE: 9pt; BACKGROUND: none transparent scroll repeat 0% 0%; COLOR: #444659; HEIGHT: 24px; TEXT-DECORATION: none
}
.L3 A:link {
 DISPLAY: block; PADDING-LEFT: 13px; FONT-SIZE: 9pt; BACKGROUND: none transparent scroll repeat 0% 0%; COLOR: #444659; HEIGHT: 24px; TEXT-DECORATION: none
}
.L3 A:visited {
 DISPLAY: block; PADDING-LEFT: 13px; FONT-SIZE: 9pt; BACKGROUND: none transparent scroll repeat 0% 0%; COLOR: #444659; HEIGHT: 24px; TEXT-DECORATION: none
}
.L21 A:link SPAN {
 PADDING-RIGHT: 0px; PADDING-LEFT: 16px; BACKGROUND: url(../images/ico/ar.png) no-repeat left center; PADDING-BOTTOM: 0px; VERTICAL-ALIGN: middle; WIDTH: 100%; CURSOR: hand; PADDING-TOP: 7px
}
.L21 A:visited SPAN {
 PADDING-RIGHT: 0px; PADDING-LEFT: 16px; BACKGROUND: url(../images/ico/ar.png) no-repeat left center; PADDING-BOTTOM: 0px; VERTICAL-ALIGN: middle; WIDTH: 100%; CURSOR: hand; PADDING-TOP: 7px
}
.L22 A:link SPAN {
 PADDING-RIGHT: 0px; PADDING-LEFT: 16px; BACKGROUND: url(../images/ico/ar.png) no-repeat left center; PADDING-BOTTOM: 0px; VERTICAL-ALIGN: middle; WIDTH: 100%; CURSOR: hand; PADDING-TOP: 7px
}
.L22 A:visited SPAN {
 PADDING-RIGHT: 0px; PADDING-LEFT: 16px; BACKGROUND: url(../images/ico/ar.png) no-repeat left center; PADDING-BOTTOM: 0px; VERTICAL-ALIGN: middle; WIDTH: 100%; CURSOR: hand; PADDING-TOP: 7px
}
.L3 A:link SPAN {
 PADDING-RIGHT: 0px; PADDING-LEFT: 16px; BACKGROUND: url(../images/ico/ar.png) no-repeat left center; PADDING-BOTTOM: 0px; VERTICAL-ALIGN: middle; WIDTH: 100%; CURSOR: hand; PADDING-TOP: 7px
}
.L3 A:visited SPAN {
 PADDING-RIGHT: 0px; PADDING-LEFT: 16px; BACKGROUND: url(../images/ico/ar.png) no-repeat left center; PADDING-BOTTOM: 0px; VERTICAL-ALIGN: middle; WIDTH: 100%; CURSOR: hand; PADDING-TOP: 7px
}
.L22 A:link SPAN {
 BACKGROUND: none transparent scroll repeat 0% 0%
}
.L22 A:visited SPAN {
 BACKGROUND: none transparent scroll repeat 0% 0%
}
.L3 A:link SPAN {
 BACKGROUND: none transparent scroll repeat 0% 0%
}
.L3 A:visited SPAN {
 BACKGROUND: none transparent scroll repeat 0% 0%
}
.L21 A:hover {
 FONT-WEIGHT: bold; BACKGROUND: url(../images/btn/menu2_bg.png) no-repeat left top
}
.L22 A:hover {
 FONT-WEIGHT: bold; BACKGROUND: url(../images/btn/menu2_bg.png) no-repeat left top
}
.L3 A:hover {
 FONT-WEIGHT: bold; BACKGROUND: url(../images/btn/menu2_bg.png) no-repeat left top
}
.L3 A:link SPAN {
 PADDING-RIGHT: 0px; PADDING-LEFT: 25px; PADDING-BOTTOM: 3px; PADDING-TOP: 12px
}
.L3 A:visited SPAN {
 PADDING-RIGHT: 0px; PADDING-LEFT: 25px; PADDING-BOTTOM: 3px; PADDING-TOP: 12px
}
.L21 A.active:link {
 BACKGROUND: none transparent scroll repeat 0% 0%
}
.L21 A.active:hover {
 BACKGROUND: none transparent scroll repeat 0% 0%
}
.L21 A.active:active {
 BACKGROUND: none transparent scroll repeat 0% 0%
}
.L21 A.active:visited {
 BACKGROUND: none transparent scroll repeat 0% 0%
}
.L21 A.active:link SPAN {
 FONT-WEIGHT: bold; BACKGROUND: url(../images/ico/ad.png) no-repeat left center; COLOR: #000000
}
.L21 A.active:hover SPAN {
 FONT-WEIGHT: bold; BACKGROUND: url(../images/ico/ad.png) no-repeat left center; COLOR: #000000
}
.L21 A.active:active SPAN {
 FONT-WEIGHT: bold; BACKGROUND: url(../images/ico/ad.png) no-repeat left center; COLOR: #000000
}
.L21 A.active:visited SPAN {
 FONT-WEIGHT: bold; BACKGROUND: url(../images/ico/ad.png) no-repeat left center; COLOR: #000000
}
.L22 A.active:link {
 BACKGROUND: url(../images/btn/menu2_bg.png) no-repeat 0px -24px
}
.L22 A.active:hover {
 BACKGROUND: url(../images/btn/menu2_bg.png) no-repeat 0px -24px
}
.L22 A.active:active {
 BACKGROUND: url(../images/btn/menu2_bg.png) no-repeat 0px -24px
}
.L22 A.active:visited {
 BACKGROUND: url(../images/btn/menu2_bg.png) no-repeat 0px -24px
}
.L3 A.active:link {
 BACKGROUND: url(../images/btn/menu2_bg.png) no-repeat 0px -24px
}
.L3 A.active:hover {
 BACKGROUND: url(../images/btn/menu2_bg.png) no-repeat 0px -24px
}
.L3 A.active:active {
 BACKGROUND: url(../images/btn/menu2_bg.png) no-repeat 0px -24px
}
.L3 A.active:visited {
 BACKGROUND: url(../images/btn/menu2_bg.png) no-repeat 0px -24px
}
.L22 A.active:link SPAN {
 FONT-WEIGHT: bold; BACKGROUND: none transparent scroll repeat 0% 0%; COLOR: #ffffff
}
.L22 A.active:hover SPAN {
 FONT-WEIGHT: bold; BACKGROUND: none transparent scroll repeat 0% 0%; COLOR: #ffffff
}
.L22 A.active:active SPAN {
 FONT-WEIGHT: bold; BACKGROUND: none transparent scroll repeat 0% 0%; COLOR: #ffffff
}
.L22 A.active:visited SPAN {
 FONT-WEIGHT: bold; BACKGROUND: none transparent scroll repeat 0% 0%; COLOR: #ffffff
}
.L3 A.active:link SPAN {
 FONT-WEIGHT: bold; BACKGROUND: none transparent scroll repeat 0% 0%; COLOR: #ffffff
}
.L3 A.active:hover SPAN {
 FONT-WEIGHT: bold; BACKGROUND: none transparent scroll repeat 0% 0%; COLOR: #ffffff
}
.L3 A.active:active SPAN {
 FONT-WEIGHT: bold; BACKGROUND: none transparent scroll repeat 0% 0%; COLOR: #ffffff
}
.L3 A.active:visited SPAN {
 FONT-WEIGHT: bold; BACKGROUND: none transparent scroll repeat 0% 0%; COLOR: #ffffff
}
.Ls A:link {
 PADDING-RIGHT: 4px; FONT-SIZE: 9pt; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-TOP: 4px; HEIGHT: 20px; TEXT-ALIGN: right; TEXT-DECORATION: underline
}
.Ls A:visited {
 PADDING-RIGHT: 4px; FONT-SIZE: 9pt; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-TOP: 4px; HEIGHT: 20px; TEXT-ALIGN: right; TEXT-DECORATION: underline
}
.Ls A:hover {
 PADDING-RIGHT: 4px; FONT-SIZE: 9pt; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-TOP: 4px; HEIGHT: 20px; TEXT-ALIGN: right; TEXT-DECORATION: underline
}
.Ls A:active {
 PADDING-RIGHT: 4px; FONT-SIZE: 9pt; BACKGROUND: none transparent scroll repeat 0% 0%; PADDING-TOP: 4px; HEIGHT: 20px; TEXT-ALIGN: right; TEXT-DECORATION: underline
}
#bottom {
 BACKGROUND: url(../images/img/menu_bottom_bg.gif) no-repeat; HEIGHT: 80px
}

js文件:/js/menu.js

var cur_id = "";
var flag = 0, sflag = 0;

//-------- 菜单点击事件 -------
function c(srcelement) {
 var targetid, srcelement, targetelement;
 var strbuf;
 //-------- 如果点击了展开或收缩按钮---------
 targetid = srcelement.id + "d";
 targetelement = document.getElementById(targetid);
 if (targetelement.style.display == "none") {
  //展开
  srcelement.className = "active";
  targetelement.style.display = '';
  menu_flag = 0;

	  var imgElt = document.getElementById(srcelement.id+"Image");
       imgElt.src = "../images/jian.png";

 } else {
  //收缩
  srcelement.className = "";
  targetelement.style.display = "none";//收缩
  menu_flag = 1;

	  var imgElt = document.getElementById(srcelement.id+"Image");
       imgElt.src = "../images/jia.png";

 }
}

//-------- 菜单全部展开/收缩 -------
var menu_flag = 1;
function menu_expand() {
 if (menu_flag == 1)
  expand_text.innerHTML = "收缩";
 else
  expand_text.innerHTML = "展开";
 menu_flag = 1 - menu_flag;
// var links = document.getElementsByTagName("A");
// for (i = 0; i < links.length; i++) {
//  srcelement = links[i];
//  if (srcelement.parentNode.className.toUpperCase() == "L1"
//    || srcelement.parentNode.className.toUpperCase() == "L21") {
//   targetelement = document.getElementById(srcelement.id + "d");
//   if (menu_flag == 0) {
//    targetelement.style.display = '';
//    srcelement.className = "active";
//   } else {
//    targetelement.style.display = "none";
//    srcelement.className = "";
//   }
//  }
// }

}

function set_current(id) {
 cur_link = document.getElementById("f" + cur_id)
 if (cur_link)
  cur_link.className = "";
 cur_link = document.getElementById("f" + id);
 if (cur_link)
  cur_link.className = "active";
 cur_id = id;
}

//-------- 打开网址 -------
function a(URL, id) {
 set_current(id);
// if (URL.substr(0, 7) != "http://" && URL.substr(0, 6) != "ftp://")
//  URL = "/general/" + URL;
 parent.openURL(URL, 0);
}

function b(URL, id) {
 set_current(id);
// URL = "/app/" + URL;
 parent.openURL(URL, 0);
}

//add by YZQ 2008-03-05 begin
function bindFunc() {
 var args = [];
 for ( var i = 0, cnt = arguments.length; i < cnt; i++) {
  args[i] = arguments[i];
 }
 var __method = args.shift();
 var object = args.shift();
 return (function() {
  var argsInner = [];
  for ( var i = 0, cnt = arguments.length; i < cnt; i++) {
   argsInner[i] = arguments[i];
  }
  return __method.apply(object, args.concat(argsInner));
 });
}
var timerId = null;
var firstTime = true;
//add by YZQ 2008-03-05 end

function d(URL, id) {
 //add by YZQ 2008-03-05 begin
 var winMgr = parent.parent.table_index.main.winManager;
 if (!winMgr) {
  if (firstTime) {
   parent.openURL("/fis/common/frame.jsp", 0);
   firstTime = false;
  }
  timerId = setTimeout(bindFunc(d, window, URL, id), 100);
  return;
 }
 firstTime = true;
 if (timerId) {
  clearTimeout(timerId);
 }
 if (winMgr) {
  winMgr.openActionPort("/fis/" + URL,
    document.getElementById("f" + id).innerText);
  return;
 }
 //add by YZQ 2008-03-05 end
 set_current(id);
 URL = "/fis/" + URL;
 parent.openURL(URL, 0);
}

//-------- 打开windows程序 -------
function winexe(NAME, PROG) {
 URL = "/general/winexe?PROG=" + PROG + "&NAME=" + NAME;
 window
   .open(
     URL,
     "winexe",
     "height=100,width=350,status=0,toolbar=no,menubar=no,location=no,scrollbars=yes,top=0,left=0,resizable=no");
}

图片资源:/images/jia.png,jian.png

java--css+js做的树形菜单(完整版),布布扣,bubuko.com

时间: 2024-10-01 22:59:27

java--css+js做的树形菜单(完整版)的相关文章

用html+css+js做打地鼠小游戏

html 代码 first.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>打地鼠</title> <link rel="stylesheet" href="first.css"> </head> <body> <

Java从数据库读取页面树形菜单

从数据库加载菜单及子菜单主要使用递归的方法,具体实现可看代码 首先封装一个菜单pojo public class Menu { // 菜单id private String id; // 菜单名称 private String name; // 父菜单id private String parentId; // 菜单url private String url; // 菜单图标 private String icon; // 菜单顺序 private int order; // 子菜单 priv

用JS制作一个信息管理平台完整版

  前  言 JRedu 在之前的文章中,介绍了如何用JS制作一个实用的信息管理平台. 但是那样的平台功能过于简陋了,我们今天来继续完善一下. 首先我们回顾一下之前的内容.   1.JSON的基础知识 1.1  什么是JSON JSON是数据交互中,最常用的一种数据格式. 由于各种语言的语法都不相同,在传递数据时,可以将自己语言中的数组.对象等转换为JSON字符串. 传递之后,可以将JSON字符串,再解析为JSON对象. JSON对象的使用与JS中的对象基本相同,唯一需要区别的是,JSON中的键

基于JS的身份证验证(完整版)

var Wi = [ 7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2, 1 ]; // 加权因子 var ValideCode = [ 1, 0, 10, 9, 8, 7, 6, 5, 4, 3, 2 ]; // 身份证验证位值.10代表X function checkIdcard(idCard) { idCard = trim(idCard);//去掉字符串头尾空格 if (idCard.length == 15) { return is

java知识分享网-springcloud视频教程下载完整版

来源[51dali资料分享网]下载地址:http://www.51dali.cn/javajiaocheng/74.html相关课程介绍:1.消息总线 2.分布式配置方法3.路由网关-zuul 4.熔断器-Hystrix 5.Ribbon负载均衡6.Ribbon初步应用7.Ribbon简介8.Eureka自我保护机制9.搭建Eureka服务注册中心10.服务注册与发现组件Eureka11.microservice-student-consumer-80服务消费者项目建立12.microservi

完整版java读取apk、ipa包名、版本名、版本号等信息

有时候,我们上传apk或者是ipa文件的时候,是需要读取到里面的一些信息的,比如软件的包名,以及其版本信息等.在网上搜索了一下资料 , 找了很多版本,对于apk文件的版本号,一直读取不到,在这里,笔者自己总结了,读取apk.ipa文件的一些代码,大家可以参考下,去其糟粕,取其精华.以便适用于自己的需求. 下面会提供源码给大家,我用的开发工具是eclipse,直接导入就可以,jar包也是我已经下载好的,大家可以免积分拿去.本来里面是有2个apk.2个ipa文件提供测试的,但是由于文件太大,上传不了

从零开始学JAVA(08)-使用SpringMVC4 Restful 风格引用静态文件 css/js/png

在写完helloworld后想给网页加点样式(*.css),结果怎么也显示不了,百度了很多种方法后试行尝试,试验成功并记录下来,方便以后查看. 时隔两年,继续学习JAVA,太久没学了,忘记得差不多,还好以前写的helloworld,还能用. 一.关于开发环境 eclipse-jee-neon-1a-win32 Jdk 1.8u112 (32位版本) SpringMVC 4.3.4.RELEASE apache-tomcat-8.5.8 二.helloworld.jsp文件中的引用的样式表为 st

关于采用css样式将多余的文字隐藏,以及实现树形菜单

前不久根据项目需要,需要写个页面,在页面中需要动态的实现一个树形的菜单,经过问度娘,选择使用一个treeTable的js插件.http://zhanchaojiang.com/demo/demo/treeTable.html这是对该插件的介绍地址.在这个插件中有如下几个树形:theme:default或者是vsStyle,默认为default,差别应该在样式上,default是加减号,vsStyle是三角.expandLevel:默认展开的层数,默认值为1.也就是刷新该页面时树状图展开的层次.c

利用多叉树实现Ext JS中的无限级树形菜单(一种构建多级有序树形结构JSON的方法)

一.问题研究的背景和意义 目前在Web应用程序开发领域,Ext JS框架已经逐渐被广泛使用,它是富客户端开发中出类拔萃的框架之一.在Ext的UI控件中,树形控件无疑是最为常用的控件之一,它用来实现树形结构的菜单.TreeNode用来实现静态的树形菜单,AsyncTreeNode用来实现动态的异步加载树形菜单,后者最为常用,它通过接收服务器端返回来的JSON格式的数据,动态生成树形菜单节点.动态生成树有两种思路:一种是一次性生成全部树节点,另一种是逐级加载树节点(利用AJAX,每次点击节点时查询下