看来 jQuery 你已经用得很爽了,想学习如何自己编写插件。非常好,这篇文档正适合你。用插件和方法来扩展 jQuery 非常强大,把最聪明的功能封装到插件中可以为你及团队节省大量开发时间。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| You are an assistant that engages in extremely thorough, self-questioning reasoning. Your approach mirrors human stream-of-consciousness thinking, characterized by continuous exploration, self-doubt, and iterative analysis. | |
| ## Core Principles | |
| 1. EXPLORATION OVER CONCLUSION | |
| - Never rush to conclusions | |
| - Keep exploring until a solution emerges naturally from the evidence | |
| - If uncertain, continue reasoning indefinitely | |
| - Question every assumption and inference |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {"sig":"231f3719d808134ed9ba8612789475ab2f3a95210d0ea95257b62a5b3fcb4a63ab0b4cd471dbfb5ee55133d30946412045e633ef2df2a9f145639facf2c89f431","msghash":"d93759d09303ed6b6ef7dfd3bb0195db8191cb51e15393ec11973fc28edd411a"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // jscs 配置文件 | |
| { | |
| disallowAnonymousFunctions: true, // 不允许匿名函数 | |
| disallowCapitalizedComments: true, // 不允许注释首字符大写 | |
| disallowCommaBeforeLineBreak: true, // 不允许逗号出现在换行符之前 | |
| disallowCurlyBraces: true, // 不允许语句后面出现不必要的大括号 | |
| disallowDanglingUnderscores: true, // 除特殊内置变量外,不允许变量名是下划线开头或结尾的 | |
| disallowEmptyBlocks: true, // 除 try catch 外,不允许空语句块 | |
| disallowFunctionDeclarations: true, // 不允许声明函数 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| // 环境定义了预定义的全局变量。 | |
| "env": { | |
| //环境定义了预定义的全局变量。更多在官网查看 | |
| "browser": true, | |
| "node": true, | |
| "commonjs": true, | |
| "amd": true, | |
| "es6":true, | |
| "mocha":true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| // 环境定义了预定义的全局变量。 | |
| "env": { | |
| //环境定义了预定义的全局变量。更多在官网查看 | |
| "browser": true, | |
| "node": true, | |
| "commonjs": true, | |
| "amd": true, | |
| "es6":true, | |
| "mocha":true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Created by andy on 2015/11/19. | |
| */ | |
| function $ (id) {return document.getElementById(id)} | |
| function show (obj) { obj.style.display = 'block'} | |
| function hide (obj) { obj.style.display = 'none'} | |
| function scroll () { | |
| if(window.pageYOffset != null) // ie9+ 和其他浏览器 | |
| { | |
| return { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| alert(hello world); |