摘要: 1. 搜索设置 File Teamplate ​ " " 2. 添加 File Teamplate " " 阅读全文
posted @ 2016-06-26 16:54 Mr.Leo 阅读(10935) 评论(0) 推荐(0) 编辑
摘要: 1. 查找设置 live " " 2. 添加代码片段 " " 3. 编写代码的时候 +Tab 即可输出代码片段 " " 启动对应代码片段的钥匙。 代码片段的名字。 代码片段的内容。 为模板中定义的变量,可以在右侧的 编辑变量 中设置变量信息及Tab顺序 4. 选择模板应用场景 " " 阅读全文
posted @ 2016-06-26 16:46 Mr.Leo 阅读(22364) 评论(0) 推荐(1) 编辑
摘要: 使用 HTML5,通过创建 cache manifest 文件,可以轻松地创建 web 应用的离线版本。 HTML5引入了应用程序缓存,这意味着 web 应用可进行缓存,并可在没有因特网连接时进行访问。 应用程序缓存为应用带来三个优势: 离线浏览 用户可在应用离线时使用它们 速度 已缓存资源加载得更 阅读全文
posted @ 2016-06-15 23:47 Mr.Leo 阅读(386) 评论(0) 推荐(0) 编辑
摘要: 快捷键 注释(// 或者/ … / ) 删除一行 重构 重命名 vcs操作 ​ 关闭重启前的本地历史纪录 最近打开的文件 工程内查找文件名 通过字符快速查找位置 文件内查找 ​ 查找下一个 ​ 查找下一个 高亮显示所有该文本,按Esc高亮消失。 快速打开光标处的类或方法 双击 全局搜索 界面操作 关 阅读全文
posted @ 2016-06-04 13:31 Mr.Leo 阅读(563) 评论(0) 推荐(0) 编辑
摘要: 经常会遇到这么个场景,需要将html代码转为JavaScript输出。 一般的做法,就是使用字符串拼接或者使用数组拼接后最终转为字符串。 常规做法: 以前,我一般是用转换工具实现,比如这个网址: "HTML to JavaScript Convertor" 用工具确实是个好方法,那有没有更好的解决方 阅读全文
posted @ 2016-05-31 10:50 Mr.Leo 阅读(441) 评论(0) 推荐(0) 编辑
摘要: 图片剪裁上传插件 "cropper" 阅读全文
posted @ 2016-05-29 15:44 Mr.Leo 阅读(694) 评论(0) 推荐(0) 编辑
摘要: ```javascript //json转url参数 var parseParam = function(param, key) { var paramStr = ""; if (param instanceof String || param instanceof Number || param instanceof Boolean) { paramStr += "&" + key + ... 阅读全文
posted @ 2016-05-18 17:38 Mr.Leo 阅读(11440) 评论(0) 推荐(0) 编辑
摘要: 一.思路 普通的1px黑色实线边框: border: 1px solid 000; 半像素边框当然不是简单地把1px改为0.5px(没测试过,可能会被解析成1或者0),border width的值只能是自然数 类似的,outline, box shadow等等也没有办法画出0.5px的细线 常规思路 阅读全文
posted @ 2016-05-18 14:12 Mr.Leo 阅读(3230) 评论(0) 推荐(0) 编辑
摘要: "three.js" 示例: ​ "打造H5里的“3D全景漫游”秘籍 腾讯ISUX" ​ "QQ物联星球计划" 通过 直接将鱼眼全景图生成立体空间的六个面;也可通过 或其他的专业3D建模工具,将鱼眼图贴到3D球面上,再将球面转为立方面,获得立体空间的六个面。 使用到的JS库: three.min.j 阅读全文
posted @ 2016-04-30 23:12 Mr.Leo 阅读(9804) 评论(0) 推荐(1) 编辑
摘要: "来自:http://www.imooc.com/code/10547" js动态计算rem "来自:https://segmentfault.com/a/1190000003690140" 阅读全文
posted @ 2016-03-02 10:44 Mr.Leo 阅读(198) 评论(0) 推荐(0) 编辑
摘要: meta标签 浏览器标签图标 参考: meta标签 :http://www.cnblogs.com/DemiGoo/articles/4313093.html Meta标签详解 :http://www.cnblogs.com/esshs/articles/157588.html 阅读全文
posted @ 2016-02-23 09:56 Mr.Leo 阅读(260) 评论(0) 推荐(0) 编辑
摘要: GitHub地址: "https://github.com/MrLeo/SeaJS" 目录结构 目录结构说明 存放HTML文件 存放所有HTML需要用到静态资源文件(css、js、img…) 存放HTML对应的业务模块 存放与业务无关的模块 Get Start 准备工作... 阅读全文
posted @ 2016-01-12 14:22 Mr.Leo 阅读(256) 评论(0) 推荐(0) 编辑
摘要: …);兼容ie8需要将::after替换成:after。</p <p 四、我们能不<strong 用js的方法来实现了</strong ?答案也是可以的 。具体代码如下:</p <p html 代码:</p <p <img src="http://p1.pstatp.com/large/3d0009... 阅读全文
posted @ 2016-01-12 11:32 Mr.Leo 阅读(762) 评论(0) 推荐(0) 编辑
摘要: UglifyJS是基于 NodeJS 的Javascript语法解析/压缩/格式化工具 Get Start 1. 安装node 2. 安装npm 3. 安装UglifyJS 4. 压缩JS 打开CMD,进入JS文件所在目录 运行uglifyjs (运行成功后会在test.js... 阅读全文
posted @ 2016-01-09 21:55 Mr.Leo 阅读(489) 评论(0) 推荐(0) 编辑
摘要: ```js /* * a.js * 普通的非cmd规范的js文件 */ function fun1(){ console.log("fun1"); //调用seajs模块中的fun1 seajs.use('./b.js',function(b){ b.fun1(); }) } /* * b.js * seajs调用的cmd模块文件 */ define(functi... 阅读全文
posted @ 2016-01-06 16:08 Mr.Leo 阅读(663) 评论(0) 推荐(0) 编辑
摘要: 1 阅读全文
posted @ 2015-09-08 16:42 Mr.Leo 阅读(484) 评论(0) 推荐(0) 编辑
摘要: 在一个项目上想用NodeJS,在前端的JS(http://localhost/xxx)中ajax访问后端RestAPI(http://localhost:3000/….)时(Chrome)报错:XMLHttpRequest cannot loadhttp://localhost:3000/auth/... 阅读全文
posted @ 2015-08-29 22:12 Mr.Leo 阅读(2462) 评论(0) 推荐(0) 编辑
摘要: See the Pen NqMwBN by Leo (@MrLeo) on CodePen. 阅读全文
posted @ 2015-07-10 00:41 Mr.Leo 阅读(251) 评论(0) 推荐(0) 编辑
摘要: dfdfdfdfdf ... 阅读全文
posted @ 2015-06-10 16:28 Mr.Leo 阅读(1215) 评论(0) 推荐(0) 编辑
摘要: 在HTML5中最基础也是比较好理解的也就是语义化标签了,,顾名思义语义化也就是可以直接读懂的标签~,这样我们在项目开发过程中不但自己不会因为5花8门的标签命名而伤脑筋,跟同事对接项目也会节约很多时间~~ 谁不想简单轻松一些呢。。。语义化标签有2种,一种是单纯语义化的,无功能,二种是语义化,且有功能的... 阅读全文
posted @ 2015-05-20 19:48 Mr.Leo 阅读(365) 评论(0) 推荐(0) 编辑
摘要: 不好的写法function CreatePerson(name,qq){//构造函数 /* new构造函数的时候 系统会自动new一个Object对象,var this = new Object(); 最后再把这个new的this对象返回,retur... 阅读全文
posted @ 2015-05-16 19:32 Mr.Leo 阅读(203) 评论(0) 推荐(0) 编辑
摘要: /* “完美运动框架”,所谓“完美”,就是可以实现多个参数,多个物体运动互不影响的一个运动函数move()。 * 大致结构如下:运动框架 EXP: move(obj,{width:200,height:200},fnEnd) * obj: 运动物体 * json: 运... 阅读全文
posted @ 2015-05-16 13:55 Mr.Leo 阅读(307) 评论(0) 推荐(0) 编辑
摘要: HTML5-Canvas Your browser does not support the canvas element. ... 阅读全文
posted @ 2015-04-26 14:19 Mr.Leo 阅读(261) 评论(0) 推荐(0) 编辑
摘要: HTML5-WebWorker web worker实时时间: 主线程获取当前时间: 主线程获取时间 webworker.j... 阅读全文
posted @ 2015-04-26 14:09 Mr.Leo 阅读(425) 评论(0) 推荐(0) 编辑
摘要: HTML5-draggable(拖放) ... 阅读全文
posted @ 2015-04-26 14:02 Mr.Leo 阅读(3015) 评论(0) 推荐(0) 编辑
摘要: HTML5 Geolocation和百度地图API结合使用 点击这个按钮,获得您的位置: 试一下 ... 阅读全文
posted @ 2015-04-26 14:00 Mr.Leo 阅读(358) 评论(0) 推荐(0) 编辑
摘要: HTML5-Video & Audio 播放/暂停 大 中 小 元素... 阅读全文
posted @ 2015-04-26 13:57 Mr.Leo 阅读(543) 评论(0) 推荐(0) 编辑
摘要: //#region UTF8编码函数function URLEncode(Str) { if (Str == null || Str == "") return ""; var newStr = ""; function toCase(sStr) { r... 阅读全文
posted @ 2015-04-24 09:20 Mr.Leo 阅读(263) 评论(0) 推荐(0) 编辑
摘要: //#region 数组var arr = [1, 2, 3, 4];//var arr = new Array(1, 2, 3, 4);console.log(arr[0]);console.log(arr.length);arr.length = 2;console.log(arr);arr.p... 阅读全文
posted @ 2015-03-30 13:15 Mr.Leo 阅读(184) 评论(0) 推荐(0) 编辑
摘要: div水平居中:设置margin的左右边距为自动div水平居中.container{ margin:0 auto;}div垂直&水平居中:已知div宽高,利用div宽高一半的负margin宽高一半负margin.container{ width: 150px; position: ... 阅读全文
posted @ 2015-03-30 10:36 Mr.Leo 阅读(1234) 评论(0) 推荐(0) 编辑
摘要: 目录页面缩放显示问题页面跳转后样式丢失js失效跳转时重复调用pageinit方法的解决办法如何调用loading效果 1页面缩放显示问题问题描述:页面似乎被缩小了,屏幕太宽了。解决办法:在head标签内加入: 2页面跳转后样式丢失js失效问题描述:用ajax跳转的时候,从a.html跳转到b.htm... 阅读全文
posted @ 2015-01-11 14:59 Mr.Leo 阅读(246) 评论(0) 推荐(0) 编辑
摘要: 用自然语言的角度理解JavaScript中的this关键字情形一:传入的参数是函数的别名,那么函数的this就是指向window;情形二:传入的参数是被new过的构造函数,那么this就是指向实例化的对象本身;情形三:如果我们想把被传入的函数对象里this的指针指向外部字面量定义的对象,那么我们就是... 阅读全文
posted @ 2014-12-07 11:31 Mr.Leo 阅读(319) 评论(0) 推荐(0) 编辑
摘要: // ==UserScript==// @name MyUserScript// @namespace https://github.com/MrLeo// @description userscript for mr.leo// @match ... 阅读全文
posted @ 2014-09-22 00:32 Mr.Leo 阅读(1248) 评论(0) 推荐(0) 编辑
摘要: /* 清除浮动 */html body div.clear, html body span.clear { background: none; border: 0; clear: both; display: block; float: none; font-si... 阅读全文
posted @ 2014-09-06 11:04 Mr.Leo 阅读(477) 评论(0) 推荐(0) 编辑
摘要: 调用测试 阅读全文
posted @ 2014-08-17 12:56 Mr.Leo 阅读(386) 评论(0) 推荐(0) 编辑
摘要: : " id="" serverAutoStart="true"> " /> ::" /> 启动站点: cd /d C:\Program Files\IIS Express ... 阅读全文
posted @ 2014-08-05 17:04 Mr.Leo 阅读(885) 评论(0) 推荐(0) 编辑
摘要: 网页可见区域宽:document.body.clientWidth;网页可见区域高:document.body.clientHeight;网页可见区域宽:document.body.offsetWidth(包括边线的宽);网页可见区域高:document.body.offsetHeight(包括边线... 阅读全文
posted @ 2014-06-14 22:53 Mr.Leo 阅读(267) 评论(0) 推荐(0) 编辑
摘要: JavaScript代码://设为首页function SetHome(obj,url){ try{ obj.style.behavior='url(#default#homepage)'; obj.setHomePage(url); }catch(e){ ... 阅读全文
posted @ 2014-06-05 12:00 Mr.Leo 阅读(744) 评论(0) 推荐(0) 编辑
摘要: 1 (function($) { 2 $.fn.PluginName = function(options) { 3 // 创建一个默认设置对象 4 var defaults = { 5 key : "DefaultValue" 6 ... 阅读全文
posted @ 2014-04-11 21:31 Mr.Leo 阅读(282) 评论(0) 推荐(0) 编辑
摘要: Google Ajax Library API使用方法1.传统方式:2.使用google.load载入:') 阅读全文
posted @ 2014-04-11 18:09 Mr.Leo 阅读(700) 评论(0) 推荐(0) 编辑