山寨坦克大战...主坦克方向:WASD,空格发射" /> <!--常量引用--> <script type="text/javascript"> //网站根目录 var __ID_HOME__="#zj_home"; //生产环境设置为true,本地设置为false var __JS_DEBUG__= true; var __JS_APP__ = ""; var __JS_APP_HOME__ = "/"; var __JS_PUBLIC__ = "/Public"; var __JS_HOME__ = "/Template/default/Home/Public"; var _URL_SIGN = "https://zhangjunbk.com:443/sign"; var _URL_LOGIN = "https://zhangjunbk.com:443/login"; var _URL_REG = "https://zhangjunbk.com:443/reg"; var _URL_FORGET = "https://zhangjunbk.com:443/forget"; var _URL_SEND_EMAIL = "https://zhangjunbk.com:443/sendEmail"; var _URL_SEND_MOBILE = "https://zhangjunbk.com:443/sendMobile"; var _URL_RELATION_EMAIL = "https://zhangjunbk.com:443/relationEmail"; var _URL_SIGN_RELATION_EMAIL = "https://zhangjunbk.com:443/sign_relation"; var _URL_FRONT_LOGOUT="/frontlogout"; var _URL_CHECK_LOGIN = "https://zhangjunbk.com:443/check_login"; var _URL_PAY_POINTS = "https://zhangjunbk.com:443/payPoints"; var _URL_PAY_POINTS_VIDEO = "https://zhangjunbk.com:443/payPointsVideo"; var _URL_USER_POINTS = "https://zhangjunbk.com:443/uindex"; var _URL_AJAX_STOCK_SEALING = "https://zhangjunbk.com:443/ajaxStockSealing"; var _URL_API_WX_CREATE = "https://zhangjunbk.com:443/wxV2Create"; var _URL_API_WX_CREATE_NATIVE_REWARD = "https://zhangjunbk.com:443/wxV2CreateNative_reward"; var _URL_CENTER_USER = "https://zhangjunbk.com:443/centerUser"; var _URL_QQ = "{https://www.zhangjunbk.com/oauth/callback/}"; </script><meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="IE=10,IE=9,IE=8"> <meta name="format-detection" content="telephone=no"> <meta name="format-detection" content="email=no"> <meta name="apple-mobile-web-app-capable" content="yes" /> <meta name="full-screen" content="true" /> <meta name="screen-orientation" content="portrait" /> <meta name="x5-fullscreen" content="true" /> <meta name="360-fullscreen" content="true" /> <!-- 百度统计开始 --> <meta name="baidu-site-verification" content="fhuh2dgO0y" /> <script> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?5e32706c09b49a23ff2fb9e0fea9be2b"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script> <!--360统计--> <meta name="360-site-verification" content="68bc23fc9ed613c8eb215b95412f6d7d" /> <script> (function(){ var hm = document.createElement("script"); hm.src = "https://jspassport.ssl.qhimg.com/11.0.1.js?d182b3f28525f2db83acfaaf6e696dba"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script> <script> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?0376e61fbe0b5a0b461b0350d3d17c40"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script> <script> (function(){ var el = document.createElement("script"); el.src = "https://lf1-cdn-tos.bytegoofy.com/goofy/ttzz/push.js?c494f88b53a15837354978ebefd8f00f9f1d0450425a0760f3ba65d1b14d5c95fd9a9dcb5ced4d7780eb6f3bbd089073c2a6d54440560d63862bbf4ec01bba3a"; el.id = "ttzz"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(el, s); })(window) </script> <!-- 百度页面自动提交开始 --> <script type="text/javascript"> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> <!-- 百度统计结束 --> <script src="/Public/static/js/jquery-3.4.1.min.js?v=1.0.4"></script> <!--图标--> <link rel="stylesheet" type="text/css" href="/Public/static/font-awesome-4.4.0/css/font-awesome.min.css?v=1.0.4"> <!--弹出框--> <link rel="stylesheet" type="text/css" href="/Template/default/Home/Public/plugin/ds-dialog/css/base.css?v=1.0.4"> <script src="/Template/default/Home/Public/plugin/ds-dialog/js/dsdialog.js?v=1.0.4"></script> <!-- pc端顶部引用 --> <!--通用样式--> <link rel="stylesheet" href="/Public/static/ueditor1_4_3/third-party/SyntaxHighlighter/shCoreDefault.css?v=1.0.1"> <link rel="stylesheet" type="text/css" href="/Template/default/Home/Public/css/zhangjun.css?v=1.0.4"> <style type="text/css"> .breadcrumbs a, a.zj-titles { font-size: 100%; } .breadcrumbs a:hover, a.zj-titles:hover { color: blue !important; } .article-content a { font-size: 100%; } .article-content a:hover { color: blue !important; } </style> </head> <body class="home blog hPC"> <!-- 导航栏 --> <style> .pc-menu-home { margin-left: 15px; } .sub-current-fixed { background: #F8AB00; color: #FFF; } .zj-sub-menus { position: absolute; width: 130px; min-width: 130px; background: #00AEFF; display: none; top: 50px; } .zj-sub-menus a { color: #fff !important; display: block !important; padding: 16px 20px !important; line-height: 30px !important; height: 30px !important; padding: 5px 20px 5px !important; margin-right: 20px !important; } .zj-mobile { display: block; } /**应用手机,pad是768px**/ @media ( max-width :768px) { .pc-menu-home { margin-left: 0px; } .zj-mobile { display: none; } .zj-sub-menus { position: relative; width: 100%; background: #00AEFF; color: #FFF !important; display: none; top: 100%; overflow: auto; max-height: 200px; } .zj-sub-menus a{ color: #FFF !important; } .sub-current-fixed a { color: #FFF !important; } } </style> <header id="header" class="header" style="position: fixed; top: 0px;"> <div id="nav-header" class="navbar"> <ul class="nav zj-mini-nav"> <a class="zj-mobile" href="/" onclick="recordId('/',0)" style="display:;"><img class="zj-img-circle" src="/Public/static/images/jun-50.png" alt="军军小站|张军博客" title="军军小站|张军博客" style="float: left; margin-top: 0px;"></a> <li class="pc-menu-home menu-item menu-item-type-post_type menu-item-object-page "><a href="/" onclick="recordId('/',0)">首页</a></li> <li cid="30" class="zj-menus zj-menu-30 menu-item menu-item-type-post_type menu-item-object-page current-menu-item current-menu-fixed"><a href="/category/30">编程技术<i class="fa fa-chevron-down"></i></a></li> <div cid="30" class="zj-sub-menus zj-sub-menu-30"> <ul> <li class="zj-sub-menu-li "> <a class="" href="/category/41">Java </a> </li><li class="zj-sub-menu-li "> <a class="" href="/category/42">C++ </a> </li><li class="zj-sub-menu-li "> <a class="" href="/category/43">C# </a> </li><li class="zj-sub-menu-li "> <a class="" href="/category/44">Python </a> </li><li class="zj-sub-menu-li "> <a class="" href="/category/57">Android </a> </li><li class="zj-sub-menu-li "> <a class="" href="/category/58">IOS </a> </li><li class="zj-sub-menu-li "> <a class="" href="/category/56">ASP.NET </a> </li><li class="zj-sub-menu-li "> <a class="" href="/category/59">Hive </a> </li><li class="zj-sub-menu-li "> <a class="" href="/category/60">Hadoop </a> </li><li class="zj-sub-menu-li "> <a class="" href="/category/61">Hbase </a> </li><li class="zj-sub-menu-li "> <a class="" href="/category/62">Spark </a> </li><li class="zj-sub-menu-li "> <a class="" href="/category/63">redis </a> </li><li class="zj-sub-menu-li "> <a class="" href="/category/64">PHP </a> </li><li class="zj-sub-menu-li "> <a class="" href="/category/65">Jquery </a> </li><li class="zj-sub-menu-li "> <a class="" href="/category/66">Javascript </a> </li><li class="zj-sub-menu-li "> <a class="" href="/category/68">CSS </a> </li><li class="zj-sub-menu-li "> <a class="" href="/category/73">批处理 </a> </li> </ul> </div><li cid="31" class="zj-menus zj-menu-31 menu-item menu-item-type-post_type menu-item-object-page "><a href="/category/31">系统架构<i class="fa fa-chevron-down"></i></a></li> <div cid="31" class="zj-sub-menus zj-sub-menu-31"> <ul> <li class="zj-sub-menu-li "> <a class="" href="/category/50">Tomcat </a> </li><li class="zj-sub-menu-li "> <a class="" href="/category/51">Weblogic </a> </li> </ul> </div><li cid="32" class="zj-menus zj-menu-32 menu-item menu-item-type-post_type menu-item-object-page "><a href="/category/32">数据库相关<i class="fa fa-chevron-down"></i></a></li> <div cid="32" class="zj-sub-menus zj-sub-menu-32"> <ul> <li class="zj-sub-menu-li "> <a class="" href="/category/45">Oracle </a> </li><li class="zj-sub-menu-li "> <a class="" href="/category/46">SqlServer </a> </li><li class="zj-sub-menu-li "> <a class="" href="/category/47">MySql </a> </li><li class="zj-sub-menu-li "> <a class="" href="/category/48">DB2 </a> </li><li class="zj-sub-menu-li "> <a class="" href="/category/49">PostgreSql </a> </li><li class="zj-sub-menu-li "> <a class="" href="/category/67">NoSQL </a> </li> </ul> </div><li cid="34" class="zj-menus zj-menu-34 menu-item menu-item-type-post_type menu-item-object-page "><a href="/category/34">操作系统<i class="fa fa-chevron-down"></i></a></li> <div cid="34" class="zj-sub-menus zj-sub-menu-34"> <ul> <li class="zj-sub-menu-li "> <a class="" href="/category/52">Windows </a> </li><li class="zj-sub-menu-li "> <a class="" href="/category/53">Linux </a> </li><li class="zj-sub-menu-li "> <a class="" href="/category/54">VMware </a> </li><li class="zj-sub-menu-li "> <a class="" href="/category/55">Ubuntu </a> </li> </ul> </div><li cid="35" class="zj-menus zj-menu-35 menu-item menu-item-type-post_type menu-item-object-page "><a href="/category/35">资料下载<i class="fa fa-chevron-down"></i></a></li> <div cid="35" class="zj-sub-menus zj-sub-menu-35"> <ul> <li class="zj-sub-menu-li "> <a class="" href="/category/72">工作经验 </a> </li> </ul> </div><li cid="38" class="zj-menus zj-menu-38 menu-item menu-item-type-post_type menu-item-object-page "><a href="/category/38">各行各业<i class="fa fa-chevron-down"></i></a></li> <div cid="38" class="zj-sub-menus zj-sub-menu-38"> <ul> <li class="zj-sub-menu-li "> <a class="" href="/category/39">教育资料 </a> </li><li class="zj-sub-menu-li "> <a class="" href="/category/37">金融业务 </a> </li><li class="zj-sub-menu-li "> <a class="" href="/category/69">交易系统 </a> </li><li class="zj-sub-menu-li "> <a class="" href="/category/71">其它 </a> </li> </ul> </div> <li cid="mt" class="zj-menus zj-menu-mt menu-item menu-item-type-post_type menu-item-object-page "><a href="/v/index">其它<i class="fa fa-chevron-down"></i></a></li> <div cid="mt" class="zj-sub-menus zj-sub-menu-mt"> <ul> <li class="zj-sub-menu-li "><a class="" href="/v/index">站内视频 </a> <li class="zj-no-wx-app zj-sub-menu-li"><a class="zj-del-target" target="_blank" href="/music/">军军音乐</a> <li class="zj-no-wx-app zj-sub-menu-li"><a class="zj-del-target" target="_blank" href="/web-nav/index.htm">网址导航</a> <li class="zj-sub-menu-li "><a class="" href="/chat">随言碎语 </a> <li class="zj-sub-menu-li "><a class="" href="/tools">赚钱工具 </a> </ul> </div> <li class="menu-item menu-item-type-post_type menu-item-object-page "><a href="/msg">云聊</a></li> <li style="background: red;" class="menu-item menu-item-type-post_type menu-item-object-page"><a target="_blank" href="https://www.shanghaijiadun.com">企业官网</a></li> <i class="zj-no-mobile fa fa-search zj-mini-search-show" style="float: right; cursor: pointer; font-size: 200%; margin: 10px; display: none; color: #FFF"></i> </ul> <div class="screen-mini"> <div style="cursor: default; height: 66px; width: 100%; margin: 0 auto; position: fixed; top: 0px; background-color: #FFF"> <i class="fa fa-list zj-mini-menu" style="float: left; cursor: pointer; font-size: 200%; margin: 20px auto 20px 10px;"></i> <div style="text-align: center; margin: 0px 15%; width: 68%; height: 100%; padding-top: 15px; font-size: 110%;"> <div style="cursor: pointer; font-weight: bold;" onclick="location.href='/'"> <span style="text-align: center; font-size: 150%;">军军小站|张军博客</span><span style="height: 4px; display: block;"></span><span>www.zhangjunbk.com</span> </div> </div> <i class="fa fa-search zj-mini-search-show" style="float: right; cursor: pointer; font-size: 200%; margin: -60px 20px 0px 0px;"></i> </div> </div> </div> </header> <!-- 百度页面自动提交开始 --> <script> (function() { var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); $(function() { }); </script> <!-- 百度页面自动提交结束 --> <section class="container"> <!-- 滚动通知栏 --> <style> .zj-system-button { cursor: pointer; color: blue; margin: 0 auto; margin-right: 15px; display: inline-block; } </style> <div class="speedbar zj-pc-speedbar" style="margin-top: 70px;"> <div class="pull-right"> <a class="zj-system-button pull-right zj-modal-sign-btn" sign-type=".zj-signs-reg" type="button"> <i class="fa fa-user"></i><span class="zj-icon-text">注册</span> </a> <a class="zj-system-button pull-right zj-modal-sign-btn" type="button"> <i class="fa fa-user"></i><span class="zj-icon-text">登录</span> </a> <!-- <a class="zj-system-button pull-right zj-centerUser" type="button"> <i class="fa fa-user"></i><span class="zj-icon-text">获取加密工具注册码</span> </a> --> </div> </div> <div class="speedbar"> <div class="toptip"> <strong class="text-success"><i class="fa fa-volume-up"></i></strong> <marquee class="zj-is-mobile" behavior="scroll" direction='left' scrollamount='3' style="width: 90%; display: none;"> 欢迎来访张军网站:连续登录【5】天博主自动为您充值【<span style="color: red; font-size: 110%;">5</span>】积分哦 </marquee> <span class="zj-is-pc" style="display: none;"> 欢迎来访张军网站:连续登录【5】天博主自动为您充值【<span style="color: red; font-size: 110%;">5</span>】积分哦 </span> <span class="zj-is-ipad" style="display: none;"> 欢迎来访张军网站:连续登录【5】天博主自动为您充值【<span style="color: red; font-size: 110%;">5</span>】积分哦 </span> </div> </div> <script type="text/javascript"> $(function() { //临时解决 if ($('.zj-pc-nav').is(':visible')) { $('.zj-pc-speedbar').css('margin-top', ($('#header').outerHeight()+10)+'px'); }else{ $('.zj-pc-speedbar').css('margin-top', '70px'); } $(window).resize(function(){ if ($('.zj-pc-nav').is(':visible')) { $('.zj-pc-speedbar').css('margin-top', ($('#header').outerHeight()+10)+'px'); }else{ $('.zj-pc-speedbar').css('margin-top', '70px'); } }); $('.zj-centerUser').click(function(){ /* web.jq.ajax({ submitUrl : _URL_CENTER_USER, hideMsg : true, rtnFunAfter : function(json) { if ($.isNull(json.url)){ ds.dialog({ title : '消息提示', content : json.msg, icon : 'info.png' }); setTimeout(function(){ //返回登录页面 window.location.href=_URL_LOGIN; },1000); }else{ window.open(json.url); } } }); */ window.open('https://www.shanghaijiadun.com/product'); }); $('.zj-centerManager').click(function(){ if (jq.browser.versions.windows||jq.browser.versions.ipad) { window.open("/Admin/Index/index"); }else{ window.location.href="/Mobile/Index/index"; } }); }); </script> <div class="content-wrap"> <div class="content"> <!-- 内容 --> <div class="breadcrumbs"> <a title="返回首页" href="/"><i class="fa fa-home" style="font-size: 138%;"></i></a> <small>></small> <a title="编程技术" href="/category/30">编程技术</a> <a title="播放" class="pull-right zj-start-voice" href="javascript:void(0);"><img src="/Public/static/images/voice.jpg" alt=""></a> </div> <script type="text/javascript"> $(function() { $('.zj-start-voice') .click( function() { document.getElementById("iform-voice").src = 'https://tts.baidu.com/text2audio?cuid=baiduid&lan=zh&ctp=1&pdt=311&spd=6&tex= 本面使用jquery-1.3.2和面定位map.jsp,支持一人和双人游戏,实现如下: 山寨坦克大战... 主坦克方向:WASD,空格发射. 副坦克方向:上下左右.L发射. ~function(){ var mainTank; //主坦克 var subTank; //副坦克 var eTanks = []; //敌坦克 var plays; //单人或者双人模式 var eTankLife = 20; //敌坦克总数量 var level = 1; //当前关数 var eTanksLength = 3; //每次显示的敌坦克数量 var maps = [map1, map2, map3]; //地图 var map; //当前地图 var u; //长定时器 var xs = [[0,12,22], [0, 8, 16, 22], [0, 6, 12, 18, 22] ]; var Gb = { attr : function(){ if (arguments.length == 1){ return Gb[arguments[0]]; }else if (arguments.length == 2){ Gb[arguments[1]] = arguments[0] return Gb; } } } //--------------------------------------Mover类-----------------------------------------'; }); }); </script> <header class="article-header"> <h1 class="article-title">垣克大战</h1> <div class="meta"> <!-- <span id="mute-category" class="muted"><i class="fa fa-list-alt"></i><a href="javascript:void(0)"> 个人随笔</a></span> --> <span class="muted"><i class="fa fa-user"></i><span class="zj-icon-text">系统</span></span> <time class="muted"> <i class="fa fa-clock-o"></i><span class="zj-icon-text">2019-08-29 23:48:09</span> </time> <span class="muted"><i class="fa fa-eye"></i><span class="zj-icon-text">1854</span></span> <span class="muted"><i class="fa fa-comments-o"></i><span class="zj-icon-text">0</span></span> </div> </header> <div class="banner banner-post"> <!-- //广告位 --> </div> <article class="article-content"> <input type="hidden" value="21700" class="zj-aid" /> <input type="hidden" value="0" class="zj-authPoints" /> <div class="newsCon">    本面使用jquery-1.3.2和面定位map.jsp,支持一人和双人游戏,实现如下: <br/>   <a href="http://img.it610.com/image/product/2674e33a2a904fb1a35a5bd928967a24.png" target="_blank"> <img src="http://img.it610.com/image/product/2674e33a2a904fb1a35a5bd928967a24.png" width="666" height="512" alt="垣克大战" style="border:1px solid black;"/> </a> <br/> <pre class="html" name="code"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <title>山寨坦克大战... 主坦克方向:WASD,空格发射. 副坦克方向:上下左右.L发射.</title> <script src="jquery-1.3.2.min.js"></script> <script src="map.js"></script> <script> ~function(){ var mainTank; //主坦克 var subTank; //副坦克 var eTanks = []; //敌坦克 var plays; //单人或者双人模式 var eTankLife = 20; //敌坦克总数量 var level = 1; //当前关数 var eTanksLength = 3; //每次显示的敌坦克数量 var maps = [map1, map2, map3]; //地图 var map; //当前地图 var u; //长定时器 var xs = [[0,12,22], [0, 8, 16, 22], [0, 6, 12, 18, 22] ]; var Gb = { attr : function(){ if (arguments.length == 1){ return Gb[arguments[0]]; }else if (arguments.length == 2){ Gb[arguments[1]] = arguments[0] return Gb; } } } //--------------------------------------Mover类--------------------------------------------- function Mover(){}; Mover.prototype = { locked : false //是否允许移动 ,stepLocked : false //移动间隔锁 ,der : false //移动方向 ,obj : null //占位,子类对应的dom ,speed : 20 //移动速度 ,moveRepeat : false //是否重复移动,默认否 ,setXy : function(y, x){this.obj.css({top:y, left:x}); return this;} ,useGird : function(){ //占据网格 var x = this.x, y = this.y; map[y][x].type = map[y][x+1].type = map[y+1][x].type = map[y+1][x+1].type = this.type; map[y][x].span = map[y][x+1].span = map[y+1][x].span = map[y+1][x+1].span = this; } ,freeGird : function(){ //释放网格 var x = this.x, y = this.y; map[y][x].type = map[y][x+1].type = map[y+1][x].type = map[y+1][x+1].type = 0; return this; } ,move : function(fn){ //移动, fn: 撞击之后触发函数 if (this.stepLocked || this.locked || this.reliveLocked) return; //如果被锁定 if (this.toBorder(this.der, fn)) { //如果撞到边界 return; } this.freeGird(); if (this.hit(fn) == 1) return; //如果遇到障碍 this.stepLocked = true; //加锁 var der = this.der, w, d; switch(der){ //计算下个网格的x,y case 0: this.x -= 1; w = 'left'; d = -2; break; case 2: this.x += 1; w = 'left'; d = 2; break; case 1: this.y -= 1; w = 'top'; d = -2; break; case 3: this.y += 1; w = 'top'; d = 2; break; } this.useGird(); //占据网格 var obj = this.obj.get(0); for (var i = 0; i < 10; i++){ //移动 var closure = ~function(i, t){ var s = setTimeout(function(){ obj.style[w] = parseInt(obj.style[w]) + d + 'px'; clearTimeout(s); if (i == 9){ closure = null; t.stepLocked = false; //移动完成的时候释放移动锁 t.moveRepeat && t.move(fn); //是否重复移动 } }, i*t.speed) }(i, this); } } ,toBorder : function(der, fn){ //撞到边界 if (der == 1 && this.y == 0 || der == 3 && this.y == 22 || der == 0 && this.x == 0 || der == 2 && this.x == 22) { if (jQuery.isFunction(fn)) fn(); return true; } } ,probe : function(){ //探测 var x = this.x, y = this.y; var baffles = []; //前方障碍 switch(this.der){ case 0 : baffles[0] = [y, x-1]; baffles[1] = [y+1, x-1]; break; //左 case 2 : baffles[0] = [y, x+2]; baffles[1] = [y+1, x+2]; break; //右 case 1 : baffles[0] = [y-1, x]; baffles[1] = [y-1, x+1]; break; //上 case 3 : baffles[0] = [y+2, x]; baffles[1] = [y+2, x+1]; break; //下 } return baffles; } } //--------------------------------------------------------坦克-------------------------------------- function Tank(obj, speed, x, y, der){ this.obj = obj; //span this.type = 5; this.speed = speed; this.x = x; this.y = y; this.der = der; //移动方向 this.fx = x; //初始x,坦克复活的时候使用 this.fy = y; //初始y this.fder = der; //初始移动方向 this.clipLength = 3; //弹夹大小,最多存放3个子弹 this.clip = []; //弹夹 this.clipLocked = false; //弹夹锁 this.fireLocked = true; this.life = 3; this.exp = []; //爆炸效果 this.invTime = 2000; //无敌时间 this.reliveLocked = false; //复活锁,复活期间不能移动 } Tank.prototype = new Mover; //继承Mover Tank.prototype.init = function(){ this.setPos(this.der); //设置坦克方向 this.setXy(this.y*20, this.x*20); //设置位置 this.useGird(this); //占据网格 this.initClip(); //初始化弹夹 if (this.invTime) this.invincible(this.invTime); //无敌 return this; } Tank.prototype.initClip = function(){ //初始化弹夹 for (var i = 0;i < this.clipLength; i++) { this.exp.push($('.explode').eq(0).clone().appendTo(Gb.attr('gameMap'))); //爆炸效果 this.clip.push(new Ball(this, 7)); } } Tank.prototype.setPos = function(der){ //设置移动方向 if (der == 0) this.der = 0; else this.der = der || this.fder; this.obj.css('background-position', '0px -'+ [3, 0, 1, 2][this.der]*40 +'px'); this.bobDer = der; //记录子弹方向 return this; } Tank.prototype.hit = function(){ //碰撞 var baffles = this.probe(); //前方物体 for (var i = 0; i < baffles.length; i++){ var type = map[baffles[i][0]][baffles[i][1]].type; if ( (/^2|3|4|5|6|7$/).test(type)) return 1; //遇到障碍 if (type == 'speed' || type == 'hide' || type == 'life' || type == 'power' || type == 'defense') { if (this == mainTank || this == subTank){ Gb.attr('.prop').hide(); Props[type](this); //吃道具 } } } return 0; } Tank.prototype.fire = function(){ //开火 if (this.reliveLocked || this.clipLocked == true || this.clip.length <= 0) { return; } this.clipLocked = true; //发射后锁定弹夹 this.clip.pop().init(); //取出一个子弹并发射 var self = this; setTimeout(function(){ //子弹间隔时间 self.clipLocked = false; }, 600) return this; } Tank.prototype.relive = function(){ //复活 this.life ? this.life-- : eTankLife--; if (this.showInfo() == 1){ this.freeGird(); if (this == mainTank){ mainTank = false; }else if (this == subTank){ subTank = false; } return; }; this.locked = true; this.der = this.fder; var me = this; setTimeout(function(){ me.freeGird(); me.x = me.fx; me.y = me.fy; if( me != mainTank && me != subTank ) me.locked = false; me.reliveLocked = false; me.clipLocked = false; me.setXy(me.y*20, me.x*20); me.setPos(me.fder); me.useGird(); me.invincible(me == mainTank ? 3000 : 1500); }, 500); return this; } Tank.prototype.showInfo = function(){ if ((plays == 1 && !mainTank.life) || (plays == 2 && !mainTank.life && !subTank.life)){ setTimeout(function(){ $('#gameOver').show(); return}, 1000); } var ary = this == mainTank ? [Gb.attr('P1'), '1P'] : [Gb.attr('P2'), '2P']; ary[0].html(ary[1]+' * ' +this.life); if (this.life <= 0) return 1; } Tank.prototype.invincible = function(time){ //坦克无敌 this.invTime = time; var i = 0, me = this; var u = setInterval(function(){ me.obj[i++ % 2 == 0 ? 'show' : 'hide'](); if (i >= time/150){ me.obj.show(); me.invTime = 0; clearTimeout(u); } }, 150); } //---------------------------------------------敌方坦克----------------------------------------------- var ETank = function(obj, speed, x, y, der){ this.obj = obj; //span this.speed = speed; this.x = x; this.y = y; this.type = 6; this.der = der; this.fx = x; this.fy = y; this.fder = der; this.life = false; this.clip = []; //弹夹 this.exp = []; //爆炸效果 this.invTime = 0; //无敌状态 } ETank.prototype = new Tank; ETank.prototype.showInfo = function(){ $('.etankSam').eq(0).remove(); if (eTankLife <= 0){ if (level == 3){ alert ('没有地图了,算你过关 - -!'); window.location.reload(); return; } level++; setTimeout(function(){mapReload()}, 100); return 1; } if (eTankLife <= eTanksLength-1){ this.freeGird(); return 1; } } ETank.prototype.Ai = function(){ this.move(); var self = this; var m = Math.round(Math.random()*100); var ary = $.grep([0,1,2,3,3,2,3,1], function(n, i){ return n != self.der; }); var len = ary.length; for (var i = 0 ; i < len ; i++){ //洗牌,下一次的方向 var num = parseInt(Math.random()*len); var tmp = ary[num]; ary[num] = ary[i]; ary[i] = tmp; } var nextDer = ary[0]; if (this.toBorder(this.der) || this.hit() == 1){ var s1 = setTimeout(function(){ self.setPos(nextDer).fire(); self.move(); var s2 = setTimeout(function(){ self.Ai(); clearTimeout(s2); }, 400) clearTimeout(s1); }, 400); return; } if (m < 20){ this.setPos(nextDer).fire(); } else if (m < 60) this.fire(); var s3 = setTimeout(function(){ self.Ai(); clearTimeout(s3); }, 200) } //---------------------------------------------------------------------------------------------------- //---------------------------------------------------------炮弹--------------------------------------- function Ball(pTank, speed){ this.obj = $('.ball').eq(0).clone().appendTo(Gb.attr('gameMap')); this.speed = speed; this.pTank = pTank; this.type = 10; this.moveRepeat = true; } Ball.prototype = new Mover; Ball.prototype.init = function(){ this.reviseXy(); var self = this; this.move(function(){ self.freeGird(); self.explode(); self.recover(); //爆炸并回收子弹 }); self.pTank.useGird(); //还原坦克所占网格 } Ball.prototype.reviseXy = function(){ //调整子弹位置 var x = this.x = this.pTank.x, y = this.y = this.pTank.y; this.der = this.pTank.bobDer || 0; //确认子弹发射方向 switch(this.der){ case 0: x -= 1; break; //左 case 1: y -= 1; break; //上 case 2: x += 1; break; //右 case 3: y += 1; break; //下 } this.setXy(y*20, x*20); } Ball.prototype.hit = function(fn){ var ret = 0; var baffles = this.probe(); //前方物体 for (var i = 0; i < baffles.length; i++){ var y = baffles[i][0], x = baffles[i][1], baffle = map[y][x], type = baffle.type, span = baffle.span; if (type == 'speed' || type == 'hide' || type == 'life' || type == 'power' || type == 'defense'){ //击中道具 if ($.isFunction(fn)) { fn()}; //爆炸 this.clearUi(y, x, span); Gb.attr('.prop').hide(); //隐藏物品 return 1; } if ((/^2|3|4|5|6|7$/).test(type)) { //爆炸 if (type == 4) { this.freeGird().recover(); //击中海洋,回收子弹但不爆炸. return 1; } if (type == 6 && this.pTank.type == 6) { //敌方坦克互相击中无效 this.freeGird().recover(); return 1; } if (type == 5 || type == 6) { if (span.invTime) { //如果处在无敌状态 this.freeGird().recover(); //回收子弹但不爆炸. return 1; } if ($.isFunction(fn)) { fn()}; span.obj.hide(); span.reliveLocked = true; span.invTime = 1; //无敌 span.relive(); //坦克复活 return 1; } if ($.isFunction(fn)) { fn()}; if (type == 7) { $('#gameOver').show(); return}; if (type == 2 || (this.type == 11 && type == 3)) { this.clearUi(y, x, span); //清除砖块 ret = 1; } else if (type == 3){ return 1; } } } return ret; } Ball.prototype.explode = function(){ //子弹爆炸 var explode = this.pTank.exp.pop(); if (!explode) return; var x = this.x, y = this.y, der = this.der; der == 0 ? x -= 1 : (der == 1 ? y -= 1 : ''); //调整爆炸位置 explode.show().css( {top: y*20, left: x*20} ); var m = Math.random()>.2; for (var i = 0; i < 8; i++){ var closure = ~function(i, t){ var s = setTimeout(function(){ explode.css('background-position', '0px -'+i*60+'px'); if (i == 7) { explode.hide(); t.pTank.exp.push(explode); } clearTimeout(s); closure = null; }, (m ? Math.sqrt(i): i*1.2)*100) }(i, this); } return this; }; Ball.prototype.clearUi = function(y, x, span){ map[y][x].type = 0; if (span.length) span.attr('className', 'aa'); } Ball.prototype.recover = function(){ //回收子弹 this.obj.css('left', '-1000px'); //扔到屏幕外 var clip = this.pTank.clip; if(clip.length < 3) clip.push(this); //回收子弹,重新装入弹夹 } //------------------------------------------道具----------------------------------------------- $(document).ready(function(){ Gb.attr($('#gameMap'), 'gameMap'); $('#bottomBg img').each(function(i){ $(this).click(function(){ plays = i == 0 ? 1 : 2; $('#gameBg').remove(); createMap(); }); $(this).hover(function(){ $(this).attr('src', i == 0 ? 'img/play12.jpg' : 'img/play22.jpg'); },function(){ $(this).attr('src', i == 0 ? 'img/play11.jpg' : 'img/play21.jpg'); }) }); $(document).keydown(function(event){ var k = event.keyCode; if ( (/^65|87|68|83$/).test(k) ) { mainTank.der = {'65':0,'87':1,'68':2,'83':3}[k]; mainTank.locked = false; } if (k == 32) mainTank.fireLocked = false; if (plays == 1) return; if ( (/^37|38|39|40$/).test(k) ) { subTank.der = k - 37; subTank.locked = false; } if (k == 76) subTank.fireLocked = false; }) $(document).keyup(function(event){ var k = event.keyCode; if ( (/^65|87|68|83$/).test(k) ) mainTank.locked = true; if (k == 32) mainTank.fireLocked = true; if (plays == 1) return; if ((/^37|38|39|40$/).test(k) ) subTank.locked = true; if (k == 76) subTank.fireLocked = true; }) }) function createMap(){ var _class = ['aa', 'wall', 'ston', 'steel', 'sea']; map = maps[level-1]; $(map).each(function(i, n){ $(n).each(function(j, n){ map[i][j] = { type : n, span : $('<span class='+_class[n]+'></span>').appendTo(Gb.attr('gameMap'))}; }) }) $('<span class=AC></span>').appendTo(Gb.attr('gameMap')); $('<span class=tank></span>').appendTo(Gb.attr('gameMap')); $('<span class=etank></span>').appendTo(Gb.attr('gameMap')); $('<span class=ball></span>').appendTo(Gb.attr('gameMap')); $('<span class=explode></span>').appendTo(Gb.attr('gameMap')); $('<span class=props></span>').appendTo(Gb.attr('gameMap')); Gb.attr($('#infoBottom'), '#infoBottom').attr($('.props'), '.prop').attr($('#gameInfo'), 'gameInfo').attr($('.tank'), '.tank').attr($('.etank'), '.etank').attr('$(.ball)', '.ball'); $('.AC').css({top : '440px',left : '240px'}); mainTank = new Tank(Gb.attr('.tank'), 15, 8, 22, 1).init(); mainTank.locked = true; if (plays == 2){ subTank = new Tank(Gb.attr('.tank').clone().appendTo(Gb.attr('gameMap')), 15, 16, 22, 1).init(); subTank.locked = true; } for (var i = 0; i < eTanksLength; i++){ var x = xs[level -1]; eTanks[i] = new ETank(Gb.attr('.etank').eq(0).clone().appendTo(Gb.attr('gameMap')), 20, x[i], 0, 3).init().Ai(); } for (var i = 0; i < eTankLife; i++){ $('<span class=etankSam></span>').appendTo(Gb.attr('gameInfo')); } $('<span class=play1>1P * ' +mainTank.life+ '</span>').appendTo(Gb.attr('#infoBottom')); if (plays == 2) $('<span class=play2>2P * ' +subTank.life+ '</span>').appendTo(Gb.attr('#infoBottom')); $('<span class=level>第 ' +level+ ' 关</span>').appendTo(Gb.attr('#infoBottom')); Gb.attr($('.play1'), 'P1').attr($('.play2'), 'P2'); Props.init(); //道具初始化 u = setInterval(function(){ if (mainTank) mainTank.setPos(mainTank.der).move(); if (mainTank && !mainTank.fireLocked) mainTank.fire(); if (plays == 1) return; if (subTank) subTank.setPos(subTank.der).move(); if (subTank && !subTank.fireLocked) subTank.fire(); }, 19); } var Props = { //道具类 Ui : [0, 0] ,init : function(){ setInterval(function(){ if (Props.use) { Gb.attr('.prop').hide(); Props.use = false; return; } var fn = ['speed', 'hide', 'life', 'power', 'defense'][Math.round(Math.random()*4)]; var Ui = Props.getUi(); Props.Ui = Ui; map[Ui[0]][Ui[1]].type = fn; Props.use = true; Gb.attr('.prop').css({'background' : 'url(img/'+ fn +'.jpg)', top : Ui[0]*20, left : Ui[1]*20} ).show(); }, Math.max(10000, Math.round(Math.random()*20000))); } ,use : false ,speed : function(obj){ obj.speed = obj.speed / 2; setTimeout(function(){ obj.speed = obj.speed * 2; Props.use = false; map[Props.Ui[0]][Props.Ui[1]].type = 0; }, 15000); } ,hide : function(obj){ obj.invincible(5000); setTimeout(function(){ Props.use = false; map[Props.Ui[0]][Props.Ui[1]].type = 0; }, 10000); } ,life : function(obj){ obj.life++; obj.showInfo(); Props.use = false; map[Props.Ui[0]][Props.Ui[1]].type = 0; } ,power : function(obj){ for (var i = 0; i < obj.clip.length; i++){ obj.clip[i].type = 11; } setTimeout(function(){ for (var i = 0; i < obj.clip.length; i++){ obj.clip[i].type = 10; } }, 10000) } ,defense : function(obj){ var ary = [[21, 11], [21, 12], [21, 13], [21, 14], [22, 11], [22, 14], [23, 11], [23, 14]]; for (var i = 0; i < ary.length; i++){ var y = ary[i][0], x = ary[i][1]; map[y][x].type = 3; map[y][x].span.attr('className', 'steel'); } setTimeout(function(){ for (var i = 0; i < ary.length; i++){ var y = ary[i][0], x = ary[i][1]; map[y][x].type = 2; map[y][x].span.attr('className', 'ston'); } }, 15000) } ,fn : false ,getUi : function(){ var i = Math.round(Math.random()*23); var j = Math.round(Math.random()*23); if (map[j][i].type == 0) { return [j, i]; } else { return this.getUi(); } } } function mapReload(){ Gb.attr('gameMap').empty(); Gb.attr('#infoBottom').empty(); $(document).keydown(function(event){ return false; }); $(document).keyup(function(event){ return false; }); clearInterval(u); mainTank = null; subTank = null; eTanks = []; eTankLife = 20; map = maps[level-1]; eTanksLength++; if (level == 3) { eTanksLength = 12; xs[2] = [0,2,4,6,8,10,12,14,16,18,20,22]; } createMap(); } }(); </script> <style> html, body{overflow:hidden} #gameBg{height:480px;width:650px;margin:3px auto;border:10px ridge #eee;background:#000;overflow:hidden;position:absolute;left:300px;top:8%;z-index:1000} #gameBg div {width:100%;height:50%} #gameBg #topBg img {margin:30px auto;display:block} #gameBg #bottomBg img {margin:20px auto;display:block;cursor:pointer;height:40px;width:150px} #gameMap{height:480px;width:480px;margin:3px auto;border:10px ridge #eee;background:#000;overflow:hidden;position:absolute;left:300px;top:8%;float:left} #gameInfo{height:480px;width:150px;margin:3px auto;border:10px ridge #eee;background:#000;overflow:hidden;position:absolute;left:790px;top:8%} #gameMap span{width:20px;height:20px;float:left} #gameMap span.steel{background:url(img/steel.gif) no-repeat} #gameMap span.sea{background:url(img/sea.gif) no-repeat} #gameMap span.wall{background:url(img/wall.gif) no-repeat;position:relative;z-index:104} #gameMap span.ston{background:url(img/ston.gif) no-repeat} #gameMap span.tank{position:absolute;background:url(img/tank.gif) no-repeat; width:40px; height:40px;z-index:101} #gameMap span.etank{background:url(img/etank.gif) no-repeat; position:absolute; width:40px; height:40px;z-index:101} #gameMap span.ball{background:url(img/ball.gif) no-repeat; position:absolute; width:40px; height:40px;z-index:103} #gameMap span.aa{background:url(); width:20px; height:20px} #gameMap span.explode{background:url(img/explode.gif) no-repeat; position:absolute; width:60px; height:60px;z-index:103} #gameMap span.props{background:url(); width:20px; height:20px; position:absolute;z-index:101} #gameMap span.info{position:absolute; width:60px; height:60px; top:100;left:100;z-index:102} #gameMap span.AC{background:url(img/1.gif) no-repeat;position:absolute; width:40px; height:40px;z-index:102} #gameInfo span.etankSam{background:url(img/etank.gif) no-repeat 0px -80px; width:40px; height:40px;float:left;margin-right:10px} #gameInfo span.play1, .play2{background:url(img/tank.gif) no-repeat; width:100%; height:40px;float:left;margin-top:25px;margin-left:10px;color:#fff;text-indent:60px;Font-weight:bold;font-size:1.2em;line-height:40px} #gameInfo span.level{width:100%;height:30px;float:left;margin-top:20px;color:#fff;text-align:center;font-weight:bold;font-size:1.2em;line-height:30px;letter-spacing:5px} #gameInfo #infoBottom{position:absolute; width:100%; height:200px; top:295px;left:0px} #gameOver{height:480px;width:650px;margin:3px auto;border:10px ridge #eee;background:#000;overflow:hidden;position:absolute;left:300px;top:8%;display:none;z-index:1001} #gameOver img{height:100%;width:100%} </style> <body> <div id="gameBg"> <div id="topBg"><img src="img/bg.jpg"></img></div> <div id="bottomBg"><img src="img/play11.jpg"></img><img src="img/play21.jpg"></img></div> </div> <div id="gameMap"> </div> <div id="gameInfo"> <div id="infoBottom"></div></div> <div id="gameOver"><img src="img/gameover.jpg"></img></div> </body> </html> </pre> <p> <a href="/article/2492064.htm" title="垣克大战"> 垣克大战 </a> </p> </div> <br /> <!-- 广告从位 --> <!-- <div class="widget widget_text"> <div class="textwidget"> <a target="_blank" href="//promotion.aliyun.com/ntms/act/qwbk.html?userCode=zmu4phlj"><img class="zj-img-enable-link" style="width: 100%" src="//img.alicdn.com/tfs/TB17qJhXpzqK1RjSZFvXXcB7VXa-200-126.jpg"> </a> </div> </div> --> <!-- <p style="color:blue;"> 如需要获取提取码,请先  <a href="javascript:void(0);" target="_self" title="军军小站|张军博客" class="zj-modal-login-btn" style="font-size: 120%">登录</a> </p> <p style="color:blue;">需要<span style="font-size:150%;color:red;font-weight:bold;margin:0px 5px;">3</span>积分才可查看,请先  <a href="/uindex" target="_blank" title="军军小站|张军博客" style="font-size: 120%">获取积分</a></p> <p> --> <!-- <p style="color:blue;"> 如需要获取提取码,请先  <a href="javascript:void(0);" target="_self" title="军军小站|张军博客" class="zj-modal-login-btn" style="font-size: 120%">登录</a> </p> <p><button class="btn btn-primary zj-auth-content-btn" target="_blank" title="军军小站|张军博客">点击获取消耗<span style="font-size:120%;font-weight:bold;margin:0px 5px;">3</span>积分</button></p> --> <p> </p> <div class="zj-qrcodes"> <div class="row"> <div class="col-xs-12 col-md-6 col-md-offset-3"> <div class="p-sm" style="overflow: hidden; padding-bottom: 15px;"> <p class="text-center">更多文章、技术交流、商务合作、联系博主</p> <p class="text-center"> 微信扫码或搜索:<span style="color: #E9405A; font-weight: bold;">z360901061</span> </p> <div class="text-center"> <img class="code-img" src="/Public/static/images/my-wx.png"> </div> <div class="text-center"> <p style="color: #e9415a; font-size: 15px;">微信扫一扫加我为好友</p> <p> <span>QQ号联系: </span><span style="color: #e9415a; font-size: 15px; margin-bottom: 45px;"> 360901061</span> </p> </div> </div> </div> </div> </div> <div class="zj-qrcodes"> <div class="row"> <div class="col-xs-12 col-md-6 col-md-offset-3"> <div class="p-sm" style="overflow: hidden; padding-bottom: 15px;"> <p class="text-center">您的支持是博主写作最大的动力,如果您喜欢我的文章,感觉我的文章对您有帮助,请用微信扫描下面二维码支持博主2元、5元、10元、20元等您想捐的金额吧,狠狠点击下面给点支持吧,站长非常感激您!手机微信长按不能支付解决办法:请将微信支付二维码保存到相册,切换到微信,然后点击微信右上角扫一扫功能,选择支付二维码完成支付。</p> <p class="text-center"> <span class="usemoney" style="color: #E9405A; font-weight: bold; font-size: 120%">【本文对您有帮助就好】</span>元 </p> <div class="text-center qrcode" style="width: 200px; height: 200px; text-align: center; margin: 0 auto;"> <img class="code-img" src="/Public/static/images/my-skm.png"> </div> <div class="text-center" style="margin-top: 10px;"> <div class="zj-radio"> <input name="moneys" value="2" id="money-2" class='moneys' type="radio"> <label for="money-2" class="zj-radio-label">2元</label> </div> <div class="zj-radio"> <input name="moneys" value="5" id="money-5" class='moneys' type="radio"> <label for="money-5" class="zj-radio-label">5元</label> </div> <div class="zj-radio"> <input name="moneys" value="10" id="money-10" class='moneys' type="radio"> <label for="money-10" class="zj-radio-label">10元</label> </div> <div class="zj-radio"> <input name="moneys" value="20" id="money-20" class='moneys' type="radio"> <label for="money-20" class="zj-radio-label">20元</label> </div> <div class="zj-radio"> <input name="moneys" value="0" id="money-0" class='moneys' type="radio"> <label for="money-0" class="zj-radio-label">自定义</label> </div> <input disabled="disabled" class="othermoney" value="" style="width: 55px; line-height: 30px; height: 30px" /> <!-- <div class="radio"> <input id="radio-3" name="radio" type="radio" disabled> <label for="radio-3" class="radio-label">5元</label> </div> --> </div> <div class="text-center" style="margin-top: 10px;"> <button class="zj-pay-s zj-pay zj-user-pay-btn btn btn-warning" type="button" style="display: none; height: 36px !important; margin-left: 20px; width: 100px;">喜欢作者</button> </div> </div> </div> </div> </div> </article> <div class="text-center qrcode_hide" style="width: 200px; height: 200px; text-align: center; margin: 0 auto;display:none;"> </div> <div style="background: #fff; padding-bottom: 20px; font-size: 14px; display: none;"> <!-- <img src="/Upload/image/ueditor/20190814/1565782795994997.png"/> --> <p style="text-align: center; margin-bottom: 20px; padding: 0px 20px">您的支持是博主写作最大的动力,如果您喜欢我的文章,感觉我的文章对您有帮助,请用微信扫描上面二维码支持博主2元、5元、10元、自定义金额等您想捐的金额吧,站长会非常 感谢您的哦!!!</p> <p style="text-align: center;"> <!-- <a target="_blank" href="/Upload/image/ueditor/20190814/1565782795994997.png"><input style="width: 310px; margin: 10px auto 0px; background-color: #00AEFF; color: #ffffff; height: 40px; border: none; font-family: 'Microsoft Yahei'; font-size: 16px; letter-spacing: 2px;" type="button" value="我要小额赞助"></a> --> <a href="javascript:void(0)"> <input style="width: 310px; margin: 10px auto 0px; background-color: #00AEFF; color: #ffffff; height: 40px; border: none; font-family: 'Microsoft Yahei'; font-size: 16px; letter-spacing: 2px;" type="button" value="我要小额赞助"> </a> </p> </div><footer class="article-footer"> </footer> <!-- 上下篇文章(id代表点击取消回复评论跳转到这) --> <nav id="this-area" class="article-nav"> <span class="article-nav-prev"><i class="fa fa-angle-double-left"></i> <a href="/article/21701" rel="prev">VMWare 三种连网工作模式(bridged、host-only、</a></span> <span class="article-nav-next"><a href="/article/21699" rel="next">Android数据库管理软件AndSQLite 1.1版本发布</a> <i class="fa fa-angle-double-right"></i></span> </nav> <!-- 评论插件 --> <!-- 引入通用评论开始 --> <div class="respond no_webshot"> <div class="comt-title zj-comment-title"> <div class="comt-avatar pull-left"> <img src="/Public/static/images/default_head_img.gif" class="avatar avatar-54 photo avatar-default zj-img-circle" height="54px" width="54px"> </div> <div class="comt-author pull-left">发表我的评论</div> <!-- <a class="pull-right cancel-comment-reply-link" href="javascript:;">取消评论</a> --> </div> <div class="comt zj-comment-area"> <div class="comt-box"> <textarea placeholder="写点什么..." class="input-block-level comt-area v-comment" name="w" cols="100%" rows="3" tabindex="1"></textarea> <textarea name="comment" cols="100%" rows="4" style="display: none"></textarea> <div class="comt-ctrl"> <button class="btn btn-success pull-right zj-comment-cancel" type="button" tabindex="5" style="margin-left: 10px; display: none"> <span class="zj-icon-text">取消回复</span> </button> <button class="btn btn-primary pull-right zj-comment-send" type="button" tabindex="5" style="margin-left: 10px;" aid="21700" pid=""> <i class="fa fa-check-square-o"></i><span class="zj-icon-text">提交评论</span> </button> <span style="display:none;" data-type="comment-insert-smilie" class="muted comt-smilie"><i class="fa fa-smile-o"></i><span class="zj-icon-text" style="cursor: pointer;" onclick="alert('暂时未开放');">表情</span></span> </div> </div> </div> </div> <div class="postcomments"> <div class="comments"> <span style="float: left;"><i class="fa fa-comments-o"></i><span class="zj-icon-text"">最新评论</span></span> <span style="float: right;"><i class="fa fa-comments-o"></i><span class="zj-icon-text"">总共<span style="color: red; font-size: 120%;">0</span>条评论 </span></span> </div> <ol class="commentlist zj-commentlist"> </ol> <div class="commentnav"></div> </div> <script type="text/javascript"> $(function() { //closest和parents的主要区别是:1,前者从当前元素开始匹配寻找,后者从父元素开始匹配寻找;2,前者逐级向上查找,直到发现匹配的元素后就停止了,后者一直向上查找直到根元素,然后把这些元素放进一个临时集合中,再用给定的选择器表达式去过滤;3,前者返回0或1个元素,后者可能包含0个,1个,或者多个元素。 var ajaxCommentUrl = "https://zhangjunbk.com:443/ajax_comment"; //回复评论 $(document).on('click','.zj-comment-reply', function() { //修改pid和nickname var pid=$(this).attr('pid'); var username=$(this).attr('username'); //设置回复的pid $('.zj-comment-send').attr('pid',pid).attr('username',username); var meta = $(this).closest('.zj-comment-meta'); meta.after($('.zj-comment-area')); $('.zj-comment-cancel').show(); $('.v-comment').focus(); }); //取消评论 $(document).on('click', '.zj-comment-cancel',function() { var area = $(this).closest('.zj-comment-area'); $('.zj-comment-cancel').hide(); $('.zj-comment-title').after(area); //设置顶层清除pid和nickname $('.zj-comment-send').attr('pid','').attr('username',''); window.location.href='#this-area'; $('.v-comment').focus(); }); //提交评论 $(document).on('click','.zj-comment-send', function() { var othis = $(this); var data = checkLogin(); //var data = true; if(data){ var content = $.trim($('.v-comment').val()); if (content==''){ ds.dialog({ title : '消息提示', content : '请输入评论内容', icon : 'info.png' }); return false; } var aid=othis.attr('aid'), pid=othis.attr('pid'), postData={ "aid":aid, "pid":pid, 'content':content, 'email':'', 'type':1 }; // ajax评论 $.post(ajaxCommentUrl, postData, function(data) { var newPid=data; var replyName=othis.attr('username'); var now = new Date(); // 获取当前时间 var date=now.getFullYear()+"-"+((now.getMonth()+1)<10?"0":"")+(now.getMonth()+1)+"-"+(now.getDate()<10?"0":"")+now.getDate()+' '+(now.getHours()<10?"0":"")+now.getHours()+':'+(now.getMinutes()<10?"0":"")+now.getMinutes()+':'+(now.getSeconds()<10?"0":"")+now.getSeconds(); var headImg=''; var nickName=''; if ($('.zj-head_img').length>0){ headImg=$('.zj-head_img').attr('src'); nickName=$('.zj-head_img').attr('title'); }else{ headImg='/Public/static/images/default_head_img.gif'; nickName='service@shanghaijiadun.com'; } if(pid==''){ // pid为空表示新增评论 var html = ''; html += '<li class="comment even thread-even depth-1">'; html += '<div class="c-avatar">'; html += '<img title="'+nickName+'" alt="'+nickName+'" class="avatar avatar-54 photo zj-img-circle" height="54" width="54" src="'+headImg+'">'; html += '<div class="c-main">'; html += content; html += '<div class="c-meta zj-comment-meta">'; html += '<i class="fa fa-user"></i><span class="zj-icon-text c-author">'+nickName+'</span>'+date+' <a title="回复给'+nickName+'" aid="'+aid+'" pid="'+newPid+'" username="'+nickName+'" rel="nofollow" class="comment-reply-link zj-comment-reply" href="javascript:void(0)">回复</a>'; html += '</div>'; html += '<!-- 添加到此评论区域 -->'; html += '</div>'; html += '</div>'; html += '</li>'; $('.zj-commentlist').prepend(html); }else{ // pid不为空表示是回复评论 var html = ''; html += '<ul class="children">'; html += '<li class="comment byuser comment-author-cqcre bypostauthor odd alt depth-2"><div class="c-avatar">'; html += '<img title="'+nickName+'" alt="'+nickName+'" class="avatar avatar-54 photo zj-img-circle" height="54" width="54" src="'+headImg+'">'; html += '<div class="c-main">'; html += content; html += '<div class="c-meta zj-comment-meta">'; html += '<i class="fa fa-user"></i><span class="zj-icon-text c-author"><span style="color:red;">'+nickName+'</span><span style="margin: 0 10px;">回复</span><span style="color:blue">'+replyName+'</span></span>'+date+' <a title="回复给'+nickName+'" aid="'+aid+'" pid="'+newPid+'" username="'+nickName+'" rel="nofollow" class="comment-reply-link zj-comment-reply" href="javascript:void(0)">回复</a>'; html += '</div>'; html += '</div>'; html += '</div></li>'; html += '<!-- #comment-## -->'; html += '</ul>'; othis.closest('li').after(html); } //清除评论框 $('.v-comment').val(''); }); }else{ //未登录 showLogin(); } }); }); </script> <script type="text/javascript"> $(function() { var V_pc = jq.browser.versions.windows; if (V_pc) { $('.zj-pay-s').hide(); } else { $('.zj-pay-s').show(); } var R_id = "21700"; var V_title = '打赏军军小站|张军博客'; var V_get_title = '获取资料'; var R_out_trade_no = ''; /* try { // Stomp.js boilerplate var client = Stomp.client('ws://127.0.0.1:15674/ws'); //client.debug = pipe('#second'); //var print_first = pipe('#first', function(data) { // client.send('/topic/test', {"content-type":"text/plain"}, data); // }); var on_connect = function(x) { id = client.subscribe("/exchange/paynotify", function(d) { if (d.body === '订单编号') { alert('支付成功:' + d.body); } else { alert('未支付成功:' + d.body); } }); }; var on_error = function() { console.log('error'); }; client.connect('webguest', 'zhangjun', on_connect, on_error, '/'); } catch (e) { alert(e); } */ $('.zj-pay').on( 'click', function() { var V_num_money = parseInt($('.moneys:checked').val()); if (V_num_money === 0) { //取其它金额 V_num_money = parseInt($(".othermoney").val()); } if (V_num_money > 999999) { V_num_money = 999999; } //跳转到支付页面 wx.miniProgram.navigateTo({ url : '/pages/pay/pay?str_id=' + R_id + '&str_title=' + V_title + '&str_out_trade_no=' + R_out_trade_no + '&num_money=' + V_num_money * 100 }); }); function genCode(P_value) { $(".qrcode").empty(); var qrcode = new QRCode($(".qrcode").get(0), { width : 200, height : 200 }); web.jq.ajax({ submitUrl : _URL_API_WX_CREATE, hideMsg : true, options : { data : { str_title : V_title,//"垣克大战" num_money : parseInt(P_value) * 100, str_id : R_id, bool_todb : V_pc } }, rtnFun : function(json) { try { var R_result = json.data.result; var R_url = R_result.code_url; R_out_trade_no = R_result.out_trade_no; if (R_url) { qrcode.makeCode(R_url); $('.qrcode').removeAttr('title'); } } catch (e) { } } }); } function callBackMoney(P_value,P_callBack) { web.jq.ajax({ submitUrl : _URL_API_WX_CREATE, hideMsg : true, options : { data : { str_title : V_get_title,//"垣克大战" num_money : parseInt(P_value) * 100, str_id : '#'+R_id, bool_todb : V_pc } }, rtnFun : function(json) { try { var R_result = json.data.result; //var R_url = R_result.code_url; P_callBack(R_result); } catch (e) { } } }); } //genCode($(".usemoney").text()); $('.moneys').click(function() { var V_value = parseInt($(this).val()); if (V_value === 0) { //取其它金额 V_value = parseInt($(".othermoney").val()); $(".othermoney").removeAttr("disabled"); } else { $(".othermoney").attr("disabled", "disabled"); } if (isNaN(V_value)) { $(this).attr("checked", "checked"); //return false; V_value = 0; } if (V_value <= 0) { $(this).attr("checked", "checked"); //return false; } else { $('.usemoney').text(V_value); genCode($(this).val()); } }); $('.othermoney').on('blur', function() { var V_value = parseInt($(this).val()); if (isNaN(V_value)) { V_value = 0; } if (V_num_money > 999999) { V_value = 999999; } if (V_value > 0) { $('.usemoney').text(V_value); genCode($(this).val()); } }); //打开文章图片 $('.article-content img').not('.zj-img-enable-link').each(function() { if ($(this).closest('.qrcode').length === 0) { var src = 'window.open("' + $(this).attr('src') + '")'; $(this).attr('onclick', src).css('cursor', 'pointer'); } }); //支付积分 $(document).on( 'click', '.zj-auth-content-btn', function() { callBackMoney($('.zj-authPoints').val(),function(R_result){ // 开始提交表单 if (V_pc){ var R_url = R_result.code_url; $(".qrcode_hide").empty(); var qrcode = new QRCode($(".qrcode_hide").get(0), { width : 200, height : 200 }); qrcode.makeCode(R_url); $('.qrcode_hide').removeAttr('title'); setTimeout(function(){ var R_imgHtml = $('.qrcode_hide img').prop("outerHTML"); ds.dialog.content({ title:'支付成功后请刷新页面', content:'<div style="text-align:center;color:red;font-weight:bold;font-size:150%;">'+ $('.zj-authPoints').val()+' 元</div><br>' + R_imgHtml }); },1500); }else{ //跳转到支付页面 wx.miniProgram.navigateTo({ url : '/pages/pay/pay?str_id=' + '#'+R_id + '&str_title=' + V_get_title + '&str_out_trade_no=' + R_result.out_trade_no + '&num_money=' + parseInt($('.zj-authPoints').val()) * 100 }); } }); }); }); </script> <iframe id="iform-voice" name="form-voice" scrolling="no" allowtransparency="true" src="" width="100%;" height="100px" style="background: #000000; display: none;"></iframe> <style> .article-content .qrcode img { margin: 0; } .zj-radio { margin: 0.5rem; display: inline-block; } .zj-radio input[type="radio"] { position: absolute; opacity: 0; } .zj-radio input[type="radio"]+.zj-radio-label:before { content: ''; background: #f4f4f4; border-radius: 100%; border: 1px solid #b4b4b4; display: inline-block; width: 1.4em; height: 1.4em; position: relative; top: -0.2em; margin-right: 1em; vertical-align: top; cursor: pointer; text-align: center; -webkit-transition: all 250ms ease; transition: all 250ms ease; } .zj-radio input[type="radio"]:checked+.zj-radio-label:before { background-color: #3197EE; box-shadow: inset 0 0 0 4px #f4f4f4; } .zj-radio input[type="radio"]:focus+.zj-radio-label:before { outline: none; border-color: #3197EE; } .zj-radio input[type="radio"]:disabled+.zj-radio-label:before { box-shadow: inset 0 0 0 4px #f4f4f4; border-color: #b4b4b4; background: #b4b4b4; } .zj-radio input[type="radio"]+.zj-radio-label:empty:before { margin-right: 0; } </style> </div> </div> <!-- 右边栏 --> <!-- 通用右部区域开始 --> <style type="text/css"> .d_postlist .text { /* height: 30px; */ display: block; height: 100%; font-size:14px !important; width:85%; } .zj-dynamic-info li{ margin: 10px 3px; } .zj-dynamic-info .zj-a{ color: blue; cursor: pointer; } </style> <aside class="sidebar"> <div class="widget d_postlist"> <div class="title"> <h2>站内搜索</h2> </div> <ul> <li><div class="zj-search-box zj-pc-search-box"> <form class="searchform themeform" role="form" action="/search" method="get"> <input style="font-size: 120%; margin-top: 10px;" type="ext" class="search" name="search_word" placeholder="搜索从这里开始..." value=""> <i class="fa fa-search"></i> <button class="btn btn-primary" type="button" style="margin-left: -4px;height: 36px !important;"> <span class="zj-icon-text">搜索</span> </button> </form> </div></li> </ul> </div> <!-- 广告从位 --> <!-- <div class="widget widget_text"> <div class="textwidget"> <a target="_blank" href="//cloud.tencent.com/act/cps/redirect?redirect=1048&cps_key=2abacb84a7fb83f31ef4a44f26f08bf4&from=console"><img style="width: 100%" src="//upload-dianshi-1255598498.file.myqcloud.com/345-7c71532bd4935fbdd9a67c1a71e577b1767b805c.200%E7%89%88%E6%9C%ACB.jpg"> </a> </div> </div> --> <!-- <div class="widget d_postlist"> <div class="title"> <h2>动态信息</h2> </div> <ul class="zj-dynamic-info"> <li>张军充值了1元积分张军充值了1元积分张军充值了1元积分张军充值了1元积分222</li> <li>张军充值了<span class="zj-a" zj-href="#" style="" title="zzzzzzzzzzzzzzz">VIP</span>会员</li> <li>张军下载了<span class="zj-a" zj-href="#" style="" title="zzzzzzzzzzzzzzz">文章-xxx</span>资料</li> <li>工工</li> <li>工工</li> <li>工工</li> <li>工工</li> <li>工工</li> <li>工工</li> </ul> </div> --> <div class="widget d_postlist"> <div class="title"> <h2>加入交流</h2> </div> <ul> <li class="zj-no-wx-app"><a target="_blank" href="//shang.qq.com/wpa/qunwpa?idkey=f6d1df60dbb7ebc94c2c8a67b1e094e1e90677df1e943d9547d425b81bb218a5"><span style="margin-right: 10px;" class="thumbnail"><img style="max-height: 100%;" src="/Public/static/images/qq-qun.png" alt=""></span><span class="text">1. 手机QQ扫左侧二维码</span><span class="text">2. 搜Q群:542395358</span> <span class="text">3. 点击<img style="cursor: pointer;" onclick="window.open('//shang.qq.com/wpa/qunwpa?idkey=f6d1df60dbb7ebc94c2c8a67b1e094e1e90677df1e943d9547d425b81bb218a5');" border="0" src="//pub.idqqimg.com/wpa/images/group.png" alt="张军网站共享资料群" title="张军网站共享资料群"> </span></a></li> <li class="zj-no-wx-app"><a target="_blank" href="//shang.qq.com/wpa/qunwpa?idkey=29dfc8d27e6e13276b9ea9848e3a211c076e130376a7b6ef380ffcc967e8a1fc"><span style="margin-right: 10px;" class="thumbnail"><img style="max-height: 100%;" src="/Public/static/images/qq-qun.png" alt=""></span><span class="text">1. 手机QQ扫左侧二维码</span><span class="text">2. 搜Q群:922215567</span> <span class="text">3. 点击<img style="cursor: pointer;" onclick="window.open('//shang.qq.com/wpa/qunwpa?idkey=29dfc8d27e6e13276b9ea9848e3a211c076e130376a7b6ef380ffcc967e8a1fc');" border="0" src="//pub.idqqimg.com/wpa/images/group.png" alt="java技术沟通群" title="java技术沟通群"> </span></a></li> <li><a target="_blank" href="javascript:void(0)" style="cursor: text;"><span style="margin-right: 10px;" class="thumbnail"><img style="max-height: 100%;" src="/Public/static/images/wx-gzh.jpg" alt="关注企业微信公众号"></span><span class="text">1.手机微信扫左侧二维码 </span><span class="text">2. 微信中搜索:上海加盾信息科技有限公司</span></a></li> <li><a target="_blank" href="javascript:void(0)" style="cursor: text;"><span style="margin-right: 10px;" class="thumbnail"><img style="max-height: 100%;" src="/Public/static/images/wx-app-zhangjunbk.jpg" alt="关注军军小站|张军博客小程序"></span><span class="text">1.手机微信扫左侧二维码 </span><span class="text">2. 微信搜索小程序:张军博客 </span></a></li> <li><a target="_blank" href="javascript:void(0)" style="cursor: text;"><span style="margin-right: 10px;" class="thumbnail"><img style="max-height: 100%;" src="/Public/static/images/wx-app-shanghaijiadun.jpg" alt="关注企业微信小程序"></span><span class="text">1.手机微信扫左侧二维码 </span><span class="text">2. 微信搜索小程序:上海加盾信息科技有限公司</span></a></li> <li><a target="_blank" href="javascript:void(0)" style="cursor: text;"><span style="margin-right: 10px;" class="thumbnail"><img style="max-height: 100%;" src="/Public/static/images/dingding.jpg" alt="关注企业钉钉"></span><span class="text">关注企业钉钉 </span></a></li> <li><a target="_blank" href="javascript:void(0)" style="cursor: text;"><span style="margin-right: 10px;" class="thumbnail"><img style="max-height: 100%;" src="/Public/static/images/qywx-my.png" alt="关注企业微信"></span><span class="text">关注企业微信 </span></a></li> <li><a target="_blank" href="javascript:void(0)" style="cursor: text;"><span style="margin-right: 10px;" class="thumbnail"><img style="max-height: 100%;" src="/Public/static/images/wx.zhangjunbk.com.png" alt="微信扫一扫添加张军网站微信群"></span><span class="text">微信扫一扫添加张军网站微信群 </span></a></li> <li><a target="_blank" href="javascript:void(0)" style="cursor: text;"><span style="margin-right: 10px;" class="thumbnail"><img style="max-height: 100%;" src="/Public/static/images/my-wx.png" alt="添加我为微信好友"></span><span class="text">微信扫一扫加我为好友 </span></a></li> </ul> </div> <div class="widget d_postlist"> <div class="title"> <h2>猜你喜欢</h2> </div> <ul> <li><a class="zj-titles" href="/article/31314" title="RedisUtil工具类"> <span class="thumbnail"> <img style="max-height:86px;" src="/Public/static/images/article/3.jpg" alt="" title=""> </span> <span class="text" style="display: block;font-size: 110%;margin-bottom: 5px;">RedisUtil工具类</span> <span class="muted" style="display: block;font-size: 90%;">在Redis中数据都是以key-value的形式存储的,key规定只能是string类型的,所以我们</span> <!-- <span class="muted">2018-01-25</span><span class="muted">551评论</span> --> </a></li><li><a class="zj-titles" href="/article/31313" title="缓存技术相关"> <span class="thumbnail"> <img style="max-height:86px;" src="/Upload/image/ueditor/20231208/1702015708864605.png" alt="" title=""> </span> <span class="text" style="display: block;font-size: 110%;margin-bottom: 5px;">缓存技术相关</span> <span class="muted" style="display: block;font-size: 90%;">redis-server.exe 服务器启动命令 redis-cli.exe 命令行客户端 re</span> <!-- <span class="muted">2018-01-25</span><span class="muted">551评论</span> --> </a></li><li><a class="zj-titles" href="/article/31312" title="定义一个时间类 Time,它能表示 24 小时制的时、分、秒,具体要求如下"> <span class="thumbnail"> <img style="max-height:86px;" src="/Public/static/images/article/15.jpg" alt="" title=""> </span> <span class="text" style="display: block;font-size: 110%;margin-bottom: 5px;">定义一个时间类 Time,它能表示 24 小时制的时、分、秒,具体要求如下</span> <span class="muted" style="display: block;font-size: 90%;">(20 分) 定义一个时间类 Time,它能表示 24 小时制的时、分、秒,具体要求如下: (1)</span> <!-- <span class="muted">2018-01-25</span><span class="muted">551评论</span> --> </a></li><li><a class="zj-titles" href="/article/31309" title="java正则表达式 过滤特殊字符的正则表达式"> <span class="thumbnail"> <img style="max-height:86px;" src="/Public/static/images/article/7.jpg" alt="" title=""> </span> <span class="text" style="display: block;font-size: 110%;margin-bottom: 5px;">java正则表达式 过滤特殊字符的正则表达式</span> <span class="muted" style="display: block;font-size: 90%;">java正则表达式 过滤特殊字符的正则表达式</span> <!-- <span class="muted">2018-01-25</span><span class="muted">551评论</span> --> </a></li><li><a class="zj-titles" href="/article/31308" title="安装DB2"> <span class="thumbnail"> <img style="max-height:86px;" src="/Upload/image/ueditor/20220315/1647305518466205.jpg" alt="" title=""> </span> <span class="text" style="display: block;font-size: 110%;margin-bottom: 5px;">安装DB2</span> <span class="muted" style="display: block;font-size: 90%;">安装DB2</span> <!-- <span class="muted">2018-01-25</span><span class="muted">551评论</span> --> </a></li><li><a class="zj-titles" href="/article/31307" title="Linux扩容分区"> <span class="thumbnail"> <img style="max-height:86px;" src="/Public/static/images/article/10.jpg" alt="" title=""> </span> <span class="text" style="display: block;font-size: 110%;margin-bottom: 5px;">Linux扩容分区</span> <span class="muted" style="display: block;font-size: 90%;">Linux扩容分区</span> <!-- <span class="muted">2018-01-25</span><span class="muted">551评论</span> --> </a></li><li><a class="zj-titles" href="/article/31306" title="输出相关路径"> <span class="thumbnail"> <img style="max-height:86px;" src="/Public/static/images/article/13.jpg" alt="" title=""> </span> <span class="text" style="display: block;font-size: 110%;margin-bottom: 5px;">输出相关路径</span> <span class="muted" style="display: block;font-size: 90%;">输出相关路径</span> <!-- <span class="muted">2018-01-25</span><span class="muted">551评论</span> --> </a></li><li><a class="zj-titles" href="/article/31305" title="输出当前目录下所有文件名到指定文件中"> <span class="thumbnail"> <img style="max-height:86px;" src="/Public/static/images/article/7.jpg" alt="" title=""> </span> <span class="text" style="display: block;font-size: 110%;margin-bottom: 5px;">输出当前目录下所有文件名到指定文件中</span> <span class="muted" style="display: block;font-size: 90%;">输出当前目录下所有文件名到指定文件中</span> <!-- <span class="muted">2018-01-25</span><span class="muted">551评论</span> --> </a></li><li><a class="zj-titles" href="/article/31304" title="删除命令参数说明"> <span class="thumbnail"> <img style="max-height:86px;" src="/Public/static/images/article/3.jpg" alt="" title=""> </span> <span class="text" style="display: block;font-size: 110%;margin-bottom: 5px;">删除命令参数说明</span> <span class="muted" style="display: block;font-size: 90%;">删除命令参数说明</span> <!-- <span class="muted">2018-01-25</span><span class="muted">551评论</span> --> </a></li><li><a class="zj-titles" href="/article/31303" title="删除前3天、前30天、前7天的文件"> <span class="thumbnail"> <img style="max-height:86px;" src="/Public/static/images/article/10.jpg" alt="" title=""> </span> <span class="text" style="display: block;font-size: 110%;margin-bottom: 5px;">删除前3天、前30天、前7天的文件</span> <span class="muted" style="display: block;font-size: 90%;">删除前3天、前30天、前7天的文件</span> <!-- <span class="muted">2018-01-25</span><span class="muted">551评论</span> --> </a></li><li><a class="zj-titles" href="/article/31302" title="多线程工作处理"> <span class="thumbnail"> <img style="max-height:86px;" src="/Public/static/images/article/16.jpg" alt="" title=""> </span> <span class="text" style="display: block;font-size: 110%;margin-bottom: 5px;">多线程工作处理</span> <span class="muted" style="display: block;font-size: 90%;">多线程工作处理、多线程工作处理简单实现类、多线程工作处理接口</span> <!-- <span class="muted">2018-01-25</span><span class="muted">551评论</span> --> </a></li><li><a class="zj-titles" href="/article/31301" title="压缩jsp,html中的代码,去掉所有空白符、换行符"> <span class="thumbnail"> <img style="max-height:86px;" src="/Public/static/images/article/3.jpg" alt="" title=""> </span> <span class="text" style="display: block;font-size: 110%;margin-bottom: 5px;">压缩jsp,html中的代码,去掉所有空白符、换行符</span> <span class="muted" style="display: block;font-size: 90%;">压缩jsp,html中的代码,去掉所有空白符、换行符</span> <!-- <span class="muted">2018-01-25</span><span class="muted">551评论</span> --> </a></li><li><a class="zj-titles" href="/article/31300" title="压缩、解压缩工具类"> <span class="thumbnail"> <img style="max-height:86px;" src="/Public/static/images/article/4.jpg" alt="" title=""> </span> <span class="text" style="display: block;font-size: 110%;margin-bottom: 5px;">压缩、解压缩工具类</span> <span class="muted" style="display: block;font-size: 90%;">压缩、解压缩工具类</span> <!-- <span class="muted">2018-01-25</span><span class="muted">551评论</span> --> </a></li><li><a class="zj-titles" href="/article/31299" title="二维码工具类"> <span class="thumbnail"> <img style="max-height:86px;" src="/Public/static/images/article/11.jpg" alt="" title=""> </span> <span class="text" style="display: block;font-size: 110%;margin-bottom: 5px;">二维码工具类</span> <span class="muted" style="display: block;font-size: 90%;">二维码工具类、支付二维码</span> <!-- <span class="muted">2018-01-25</span><span class="muted">551评论</span> --> </a></li><li><a class="zj-titles" href="/article/31298" title="缓存工具类 缓存名创建后即使移除缓存,也不会重新创建"> <span class="thumbnail"> <img style="max-height:86px;" src="/Public/static/images/article/20.jpg" alt="" title=""> </span> <span class="text" style="display: block;font-size: 110%;margin-bottom: 5px;">缓存工具类 缓存名创建后即使移除缓存,也不会重新创建</span> <span class="muted" style="display: block;font-size: 90%;">缓存工具类 缓存名创建后即使移除缓存,也不会重新创建</span> <!-- <span class="muted">2018-01-25</span><span class="muted">551评论</span> --> </a></li><li><a class="zj-titles" href="/article/31297" title="json工具类"> <span class="thumbnail"> <img style="max-height:86px;" src="/Public/static/images/article/2.jpg" alt="" title=""> </span> <span class="text" style="display: block;font-size: 110%;margin-bottom: 5px;">json工具类</span> <span class="muted" style="display: block;font-size: 90%;">json工具类</span> <!-- <span class="muted">2018-01-25</span><span class="muted">551评论</span> --> </a></li><li><a class="zj-titles" href="/article/31296" title="常量资源文件工具类"> <span class="thumbnail"> <img style="max-height:86px;" src="/Public/static/images/article/10.jpg" alt="" title=""> </span> <span class="text" style="display: block;font-size: 110%;margin-bottom: 5px;">常量资源文件工具类</span> <span class="muted" style="display: block;font-size: 90%;">常量资源文件工具类</span> <!-- <span class="muted">2018-01-25</span><span class="muted">551评论</span> --> </a></li><li><a class="zj-titles" href="/article/31295" title="资源文件工具类"> <span class="thumbnail"> <img style="max-height:86px;" src="/Public/static/images/article/16.jpg" alt="" title=""> </span> <span class="text" style="display: block;font-size: 110%;margin-bottom: 5px;">资源文件工具类</span> <span class="muted" style="display: block;font-size: 90%;">资源文件工具类</span> <!-- <span class="muted">2018-01-25</span><span class="muted">551评论</span> --> </a></li><li><a class="zj-titles" href="/article/31294" title="处理查询结果后分页排序类"> <span class="thumbnail"> <img style="max-height:86px;" src="/Public/static/images/article/17.jpg" alt="" title=""> </span> <span class="text" style="display: block;font-size: 110%;margin-bottom: 5px;">处理查询结果后分页排序类</span> <span class="muted" style="display: block;font-size: 90%;">处理查询结果后分页排序类</span> <!-- <span class="muted">2018-01-25</span><span class="muted">551评论</span> --> </a></li><li><a class="zj-titles" href="/article/31293" title="html解析工具类、html表格解析解析工具类"> <span class="thumbnail"> <img style="max-height:86px;" src="/Public/static/images/article/8.jpg" alt="" title=""> </span> <span class="text" style="display: block;font-size: 110%;margin-bottom: 5px;">html解析工具类、html表格解析解析工具类</span> <span class="muted" style="display: block;font-size: 90%;">html解析工具类、爬虫、html表格解析解析工具类、webClient工厂</span> <!-- <span class="muted">2018-01-25</span><span class="muted">551评论</span> --> </a></li> </ul> </div> <div class="widget d_tag"> <div class="title"> <h2>标签云</h2> </div> <div class="d_tags"> <a title="金融业务" href="/tag/37" onclick="return recordId('tid',37)">金融业务 (4)</a><a title="教育资料" href="/tag/39" onclick="return recordId('tid',39)">教育资料 (10)</a><a title="Java" href="/tag/41" onclick="return recordId('tid',41)">Java (901)</a><a title="C++" href="/tag/42" onclick="return recordId('tid',42)">C++ (86)</a><a title="C#" href="/tag/43" onclick="return recordId('tid',43)">C# (215)</a><a title="Python" href="/tag/44" onclick="return recordId('tid',44)">Python (9022)</a><a title="Oracle" href="/tag/45" onclick="return recordId('tid',45)">Oracle (911)</a><a title="SqlServer" href="/tag/46" onclick="return recordId('tid',46)">SqlServer (681)</a><a title="MySql" href="/tag/47" onclick="return recordId('tid',47)">MySql (600)</a><a title="DB2" href="/tag/48" onclick="return recordId('tid',48)">DB2 (33)</a><a title="PostgreSql" href="/tag/49" onclick="return recordId('tid',49)">PostgreSql (23)</a><a title="Tomcat" href="/tag/50" onclick="return recordId('tid',50)">Tomcat (825)</a><a title="Weblogic" href="/tag/51" onclick="return recordId('tid',51)">Weblogic (12)</a><a title="Windows" href="/tag/52" onclick="return recordId('tid',52)">Windows (214)</a><a title="Linux" href="/tag/53" onclick="return recordId('tid',53)">Linux (647)</a><a title="VMware" href="/tag/54" onclick="return recordId('tid',54)">VMware (32)</a><a title="Ubuntu" href="/tag/55" onclick="return recordId('tid',55)">Ubuntu (194)</a><a title="ASP.NET" href="/tag/56" onclick="return recordId('tid',56)">ASP.NET (198)</a><a title="Android" href="/tag/57" onclick="return recordId('tid',57)">Android (681)</a><a title="IOS" href="/tag/58" onclick="return recordId('tid',58)">IOS (75)</a><a title="Hive" href="/tag/59" onclick="return recordId('tid',59)">Hive (45)</a><a title="Hadoop" href="/tag/60" onclick="return recordId('tid',60)">Hadoop (50)</a><a title="Hbase" href="/tag/61" onclick="return recordId('tid',61)">Hbase (9)</a><a title="Spark" href="/tag/62" onclick="return recordId('tid',62)">Spark (4)</a><a title="redis" href="/tag/63" onclick="return recordId('tid',63)">redis (78)</a><a title="PHP" href="/tag/64" onclick="return recordId('tid',64)">PHP (145)</a><a title="Jquery" href="/tag/65" onclick="return recordId('tid',65)">Jquery (174)</a><a title="Javascript" href="/tag/66" onclick="return recordId('tid',66)">Javascript (168)</a><a title="NoSQL" href="/tag/67" onclick="return recordId('tid',67)">NoSQL (6)</a><a title="CSS" href="/tag/68" onclick="return recordId('tid',68)">CSS (127)</a><a title="资料下载" href="/tag/69" onclick="return recordId('tid',69)">资料下载 (25)</a><a title="交易系统" href="/tag/70" onclick="return recordId('tid',70)">交易系统 (9)</a><a title="java工具类" href="/tag/71" onclick="return recordId('tid',71)">java工具类 (32)</a><a title="其它" href="/tag/72" onclick="return recordId('tid',72)">其它 (7)</a><a title="秕处理" href="/tag/73" onclick="return recordId('tid',73)">秕处理 (4)</a> </div> </div> <!-- <div class="widget d_postlist"> <div class="title"> <h2>最新评论</h2> </div> <ul> <li><a href="" title="[Python3网络爬虫开发实战] 1.8-爬虫框架的安装"><span class="thumbnail"><img src="" alt="[Python3网络爬虫开发实战] 1.8-爬虫框架的安装"></span><span class="text">[Python3网络爬虫开发实战] 1.8-爬虫框架的安装</span><span class="muted">2018-01-25</span><span class="muted">551评论</span></a></li> <li><a href="" title="[Python3网络爬虫开发实战] 1.8.4-Scrapy-Redis的安装"><span class="thumbnail"><img style="width: 50px;height: 50px;" src="" alt="[Python3网络爬虫开发实战] 1.8.4-Scrapy-Redis的安装"></span><span class="text">[Python3网络爬虫开发实战] 1.8.4-Scrapy-Redis的安装</span><span class="muted">2018-01-25</span><span class="muted">370评论</span></a></li> </ul> </div> --> <div class="zj-no-wx-app widget widget_links"> <div class="title"> <h2 style="float: left;">友情链接</h2><h2 style="float: right;"><a class="zj-titles" href="/link">申请友链</a></h2> </div> <ul class="xoxo blogroll"> <li><a class="zj-titles" title="上海加盾信息科技有限公司" href="https://www.shanghaijiadun.com" target="_blank">上海加盾信息科技有限公司</a></li><li><a class="zj-titles" title="股票002162悦心健康资金分析" href="/stock/my" target="_blank">股票002162悦心健康资金分析</a></li><li><a class="zj-titles" title="张军博客" href="https://www.zhangjunbk.com/" target="_blank">张军博客</a></li><li><a class="zj-titles" title="张军博客-网址导航" href="https://www.zhangjunbk.com/web-nav/index.htm" target="_blank">张军博客-网址导航</a></li><li><a class="zj-titles" title="张军java工具类" href="http://www.zhangjunbk.com/otherlink/javatooldoc/" target="_blank">张军java工具类</a></li><li><a class="zj-titles" title="快手号出售" href="https://www.weihaoyi.com" target="_blank">快手号出售</a></li><li><a class="zj-titles" title="全球日报" href="http://qqrb.cn" target="_blank">全球日报</a></li><li><a class="zj-titles" title="张军博客-SpringBoot入门" href="https://zhangjunbk.com/Public/static/md/SpringBoot/index.html" target="_blank">张军博客-SpringBoot入门</a></li> </ul> </div> <div class="zj-no-wx-app widget widget_links"> <div class="title"> <h2 style="float: left;">demo案例</h2><h2 style="float: right;"><a class="zj-titles" href="/link">申请友链</a></h2> </div> <ul class="xoxo blogroll"> <li><a class="zj-titles" title="XXX环保设备有限公司" href="/demo/green-env" target="_blank">XXX环保设备有限公司</a></li> <li><a class="zj-titles" title="市突发预警平台实时监控" href="/demo/monitor-1" target="_blank">市突发预警平台实时监控</a></li> </ul> </div> <div class="zj-no-wx-app widget widget_links"> <div class="title"> <h2 style="float: left;">51链网站</h2> </div> <ul class="xoxo blogroll"> <li><a class="zj-titles" title="51链首页" href="https://www.51link.com?ruid=16279" target="_blank">51链首页</a></li> <li><a class="zj-titles" title="51链注册页" href="https://www.51link.com/mobileRegister?ruid=16279" target="_blank">51链注册页</a></li> <li><a class="zj-titles" title="广告出售页" href="https://www.51link.com/ad-sell?ruid=16279" target="_blank">广告出售页</a></li> <li><a class="zj-titles" title="友链出租页" href="https://www.51link.com/link-sell?ruid=16279" target="_blank">友链出租页</a></li> <li><a class="zj-titles" title="软文出售页" href="https://www.51link.com/article-sell?ruid=16279" target="_blank">软文出售页</a></li> <li><a class="zj-titles" title="友链交换页" href="https://www.51link.com/link-exchange?ruid=16279" target="_blank">友链交换页</a></li> </ul> </div> <!-- <div class="widget widget_text"> <div class="textwidget"> <a href="javascript:void(0);" style="display: none"><img src="/Public/static/advertisement/1/3.png"></a> </div> </div> --> <!-- 广告从位 --> <!-- <div class="widget widget_text"> <div class="textwidget"> <a target="_blank" href="//promotion.aliyun.com/ntms/act/enterprise-discount.html?userCode=zmu4phlj"><img style="width: 100%" src="//img.alicdn.com/tfs/TB1aDXhXpzqK1RjSZFvXXcB7VXa-259-194.jpg"> </a> </div> </div> --> <!-- 广告从位 --> <!-- <div class="widget widget_text"> <div class="textwidget"> <a target="_blank" href="//cloud.tencent.com/act/cps/redirect?redirect=1044&cps_key=2abacb84a7fb83f31ef4a44f26f08bf4&from=console"><img style="width: 100%" src="//upload-dianshi-1255598498.file.myqcloud.com/%E7%83%AD%E9%97%A8%E7%A7%92%E6%9D%801%E6%A0%B81G-345x200-ecb263a2fff4774dcdaac834589cda06ec6825ca.jpg"> </a> </div> </div> --> <!-- 广告从位 --> <!-- <div class="widget widget_text"> <div class="textwidget"> <a target="_blank" href="//www.aliyun.com/acts/hotsale?userCode=zmu4phlj"><img style="width: 100%" src="//img.alicdn.com/tfs/TB1wFYxbRv0gK0jSZKbXXbK2FXa-440-255.jpg"> </a> </div> </div> --> <!-- 广告从位 --> <!-- <div class="widget widget_text"> <div class="title"> <h2 style="float: left;">自愿打赏</h2> </div> <div class="textwidget"> <a target="_blank" href="/Upload/image/ueditor/20190814/1565782795994997.png"><img style="width: 100%" src="/Upload/image/ueditor/20190814/1565782795994997.png"> </a> </div> </div> --> </aside> <!-- 通用右部区域结束 --> <script type="text/javascript"> $(function(){ }); </script> </section> <!-- 底部 --> <!-- 通用底部文件开始 --> <footer class="footer"> <div class="footer-inner"> <div class="copyright pull-left"> <a href="/">军军小站|张军博客</a> 丨 <a target="_blank" href="https://www.shanghaijiadun.com/product#id-5">获取加密软件注册码</a>丨<a target="_blank" href="https://www.shanghaijiadun.com">上海加盾信息科技有限公司</a>丨<a href="/article/24">个人简介</a> 丨 © 2020-2030 版权所有丨<a target="_blank" href="https://beian.miit.gov.cn/">沪ICP备19026782号-2</a> | <a href="/link">申请友链</a> | 站长QQ:<a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=360901061&site=qq&menu=yes">360901061</a> </div> </div> </footer> <div class="rollto zj-rollto"> <button class="btn btn-inverse zj-totop" data-type="totop" title="回顶部" zj-title-options="direction:'left'"> <i class="fa fa-arrow-up"></i> </button> <button class="btn btn-inverse zj-torespond" data-type="torespond" title="发评论" zj-title-options="direction:'left'"> <i class="fa fa-comment-o"></i> </button> </div> <div class="zj-mark"></div> <div class="zj-search-box zj-mini-search-box" style="position: fixed; top: 0px; background: #FFF; height: 100%; width: 100%; text-align: center; display: none; background: ; z-index: 2000"> <span class="close zj-close" style="top: 3%; right: 8%; font-size: 220%; color: #000;"></span> <form class="searchform themeform" role="form" action="/search" method="get" style="margin: 20% auto;"> <input style="font-size: 120%; margin-top: 10px;" type="ext" class="search" name="search_word" placeholder="搜索从这里开始..." value=""> <button class="btn btn-primary" type="button" style="margin-left: -4px;height: 36px !important;"> <span class="zj-icon-text">搜索</span> </button> </form> </div> <!-- 张军(QQ:360901061)自定义js引用 --> <script src="/Public/static/js/wxLogin.js?v=1.0.4"></script> <script src="/Public/static/js/jweixin-1.3.2.js?v=1.0.1"></script> <script src="/Template/default/Home/Public/js/zj.basic.js?v=1.0.4"></script> <script src="/Template/default/Home/Public/js/zj.jq.ui.js?v=1.0.4"></script> <script src="/Template/default/Home/Public/js/zj.jq.js?v=1.0.4"></script> <script src="/Template/default/Home/Public/js/zj.jq.web.js?v=1.0.5"></script> <script src="/Template/default/Home/Public/js/zj.validate.js?v=1.0.4"></script> <script src="/Template/default/Home/Public/js/qrcode.min.js?v=1.0.4"></script> <script src="/Public/static/ueditor1_4_3/third-party/SyntaxHighlighter/shCore.js?v=1.0.1"></script> <script src="/Public/static/js/stomp.js?v=1.0.1"></script> <script type="text/javascript"> $(document).ready(function(){ SyntaxHighlighter.all(); }); </script> <!-- pc端底部引用 --> <script src="/Template/default/Home/Public/js/zj.app.js?v=1.0.4"></script> <script src="/Template/default/Home/Public/js/zj.login.reg.js?v=1.0.4"></script> <script type="text/javascript"> $(function() { $(".zj-rollto").returnTop($(".zj-totop")); if ($('.v-comment').length == 0) { $('.zj-torespond').remove(); } else { $('.zj-torespond').click(function() { $('.v-comment').focus(); }); } }); </script> <!-- 添加分享按钮 --> <!-- 通用底部文件结束 --> <!-- 目前手动添加 --> <script> (function(){ var src = "https://jspassport.ssl.qhimg.com/11.0.1.js?d182b3f28525f2db83acfaaf6e696dba"; document.write('<script src="' + src + '" id="sozz"><\/script>'); })(); </script> </body> </html>