0

在 JavaScript 框架(jQuery、Prototype 等)上实现新层的最佳方式是什么?

+------------+
| JavaScript |
+------------+
|   jQuery   |
+------------+
|  MyLibrary |
+------------+

例如...

MyLibrary = MyLibrary || {};

MyLibrary.animate = function(params) {
   // some code
}

MyLibrary.insert = function(params) {
   // some code
}

执行

MyLibrary.animate(params);

谢谢您的回复!

4

1 回答 1

2

为什么不使用插件扩展 jQuery来做你想做的事。尝试包装整个 jQuery 库似乎只是为了添加一些功能需要做很多工作。

于 2010-10-27T18:09:30.213 回答