OnOff极小的 JavaScript 库
OnOff 是个极小的 JavaScript 库,提供 on(), off() 和 trigger() 事件管理函数。同时还包括一个非常方便的 once() 函数,事件只能调用一次。
示例:
> // Create an instance of OnOff() > EventManager = new OnOff(); // NOTE: "new" is actually optional > // A little test function: > var testFunc = function(args) { console.log('args: ' + args + ', this.foo: ' + this.foo) }; > // Call testFunc() whenever "test_event" is triggered: > EventManager.on("test_event", testFunc); > // Fire the test_event with 'an argument' as the only argument: > EventManager.trigger("test_event", 'an argument');args: an argument, this.foo: undefined > // Remove the event so we can change it:> EventManager.off("test_event", testFunc); > // Now let's pass in a context object:> EventManager.on("test_event", testFunc, {'foo': 'bar'}); > // Now fire it just like before> EventManager.trigger("test_event", 'an argument');args: an argument, this.foo: bar
评论
OnOff极小的 JavaScript 库
OnOff是个极小的JavaScript库,提供on(),off()和trigger()事件管理函数。同时还包括一个非常方便的once()函数,事件只能调用一次。示例:> // Create a
OnOff极小的 JavaScript 库
0
Goodnight极小的 JavaScript 插件
Goodnight 是极小的 JavaScript 插件,在夜晚的时候应用特殊的 CSS 样式。在线
Goodnight极小的 JavaScript 插件
0
Goodnight极小的 JavaScript 插件
Goodnight是极小的JavaScript插件,在夜晚的时候应用特殊的CSS样式。在线演示
Goodnight极小的 JavaScript 插件
0
CSVjsCSV 的 JavaScript 解析库
CSVjs 是一个使用纯 JavaScript 实现对 CSV 内容的编解码的库。示例代码:var
CSVjsCSV 的 JavaScript 解析库
0
Tangram百度的Javascript库
Tangram是Baidu开发的一套简单可依赖的Javascript库,它的特点:*体积小巧,性能优良,使用简单。*模块化架构,方便定制与扩展。*适合团队开发,丰富的中文文档和本地技术优化,适合中国用
Tangram百度的Javascript库
0
imgix.jsimgix 的JavaScript客户端库
imgix.js 是 imgix 的JavaScript客户端库。安装:npm: npm insta
imgix.jsimgix 的JavaScript客户端库
0