构建 jQuery UI 插件

发布于 2024-07-10 04:50:43 字数 1557 浏览 10 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

裂开嘴轻声笑有多痛 2024-07-17 04:50:43

“学习 jQuery”教程

学习 jQuery 是一个非常有用的网站,并且有一个 有关插件创作的精彩教程

我真正喜欢的一项原则是:创建用户可以覆盖的默认设置

所以也许你可以说 $(this).highlight() ,它会默认突出显示蓝色。 或者你可以说 $(this).highlight("green") 它会突出显示绿色。

但您还应该可以说:

   $(this).highlight({
    foreground: 'red'
    });

...并且默认情况下它会从那时起突出显示红色。

其他好资源

Tutorial at "Learning jQuery"

Learning jQuery is a very helpful site, and has a great tutorial on plugin authoring.

One principle I really liked was: create default settings that users can override.

So maybe you can say $(this).highlight() and it will highlight blue by default. Or you can say $(this).highlight("green") and it will highlight green.

But you should also make it possible to say:

   $(this).highlight({
    foreground: 'red'
    });

...and it will highlight red from then on by default.

Other good resources

老街孤人 2024-07-17 04:50:43

您是否尝试过 Manning Publications 出版的有关 jQuery 的书籍 jQuery In Action目录表明有关于编写自己的插件的好材料。

Have you tried the Manning Publications book on jQuery, jQuery In Action? The table of contents indicates there is good material on writing your own plugins.

紙鸢 2024-07-17 04:50:43

JQuery in Action 的第 7 章是“使用自定义插件扩展 JQuery”,应该为您提供您需要的信息。

Chapter 7 of JQuery in Action is "Extending JQuery with custom Plugins" and should provide you with the information you need.

浮生未歇 2024-07-17 04:50:43

尝试这个。 本教程将引导您逐步创建自己的插件。

Try this one. This tutorial will take you step by step through creating your very own plugin.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文