随笔分类 -  HTML & CSS & JS

JavaScript - Scope of variables
摘要:It's important to note, especially if you have come to JavaScript from another language, that variables in JavaScript are not defined in a block scope 阅读全文
posted @ 2016-12-13 20:34 huey2672 阅读(310) 评论(0) 推荐(0)
jQuery.Hotkeys - lets you watch for keyboard events anywhere in your code supporting almost any key combination
摘要:AboutjQuery Hotkeys is a plug-in that lets you easily add and remove handlers for keyboard events anywhere in your code supporting almost any key comb... 阅读全文
posted @ 2015-12-23 16:31 huey2672 阅读(252) 评论(0) 推荐(0)
HTML - 键盘事件
摘要:Keyboard 事件onkeydown:在用户按下按键时触发。onkeypress:在用户敲击按钮时触发。onkeyup:当用户释放按键时触发。示例 KeyCode KeyCode 阅读全文
posted @ 2015-12-17 16:46 huey2672 阅读(609) 评论(0) 推荐(0)
Mousetrap - Keyboard shortcuts in Javascript
摘要:Mousetrap is a simple library for handling keyboard shortcuts in Javascript.It is around 2kb minified and gzipped and 4.5kb minified, has no external ... 阅读全文
posted @ 2015-12-15 20:48 huey2672 阅读(469) 评论(0) 推荐(0)
DOM - nodeType 的取值
摘要:DOM 中,共有 12 中不同类型的节点,nodeType 的取值以数值表示。节点类型描述子节点1Element表示元素。Element, Text, Comment, ProcessingInstruction, CDATASection, EntityReference2Attribute表示属... 阅读全文
posted @ 2015-10-26 12:53 huey2672 阅读(289) 评论(0) 推荐(0)
JavaScript - 运算符 == 与 === 的区别
摘要:在 JavaScript 中,运算符 == 与 === 都是用来比较两个值是否相等。但是这两个操作符有个不同的地方:== 并不表示严格相等,而 === 表示进行严格比较,不仅比较值,而且会比较变量的类型。对于 != 与 !== 也是类似的。例1:使用 == 比较 false 与 ""。例2:使用 =... 阅读全文
posted @ 2015-10-24 23:27 huey2672 阅读(290) 评论(0) 推荐(0)
Cryptography - JavaScript 加密算法库
摘要:Example 1: The following example uses aes function.Example 2: The following example uses aes function with passphrase.Example 3: The following example... 阅读全文
posted @ 2015-06-11 23:34 huey2672 阅读(796) 评论(0) 推荐(0)
JavaScript - Base64 编码解码
摘要:以下代码摘自:http://cryptojs.altervista.org/encoding/Base64.htmlfunction base64_encode(str) { if (window.btoa) // Internet Explorer 10 and above retur... 阅读全文
posted @ 2015-06-11 23:14 huey2672 阅读(507) 评论(0) 推荐(0)
HTML - base 标签
摘要:标签为页面上的所有链接规定默认地址或默认目标。通常情况下,浏览器会从当前文档的 URL 中提取相应的元素来填写相对 URL 中的空白。使用 标签可以改变这一点。浏览器随后将不再使用当前文档的 URL,而使用指定的基本 URL 来解析所有的相对 URL。这其中包括 、、、 标签中的 URL。示例代... 阅读全文
posted @ 2015-05-06 09:41 huey2672 阅读(371) 评论(0) 推荐(0)
在浏览器屏蔽右键、文本选择、文本拖动、复制等操作
摘要:事件说明oncontextmenu在用户点击鼠标右键打开上下文菜单时触发onselectstart在用户开始选取元素时触发ondragstart在用户开始拖动元素时触发oncopy在用户拷贝元素内容时触发当事件被触发,使用 return false; 语句能够禁用默认的事件行为。 hello ... 阅读全文
posted @ 2015-04-21 20:40 huey2672 阅读(1222) 评论(3) 推荐(0)
CSS 盒子模型
摘要: 阅读全文
posted @ 2015-04-02 18:57 huey2672 阅读(176) 评论(0) 推荐(0)
点击 a 标签触发事件而不跳转页面
摘要:有时候需要让 a 标签像 button 一样,被点击的时候触发事件而不跳转页面。 Click a1 Click a2 Click a3 阅读全文
posted @ 2015-03-05 13:08 huey2672 阅读(1579) 评论(0) 推荐(0)