Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 10 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(4)
“学习 jQuery”教程
学习 jQuery 是一个非常有用的网站,并且有一个 有关插件创作的精彩教程。
我真正喜欢的一项原则是:创建用户可以覆盖的默认设置。
所以也许你可以说 $(this).highlight() ,它会默认突出显示蓝色。 或者你可以说 $(this).highlight("green") 它会突出显示绿色。
但您还应该可以说:
...并且默认情况下它会从那时起突出显示红色。
其他好资源
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:
...and it will highlight red from then on by default.
Other good resources
您是否尝试过 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.
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.
尝试这个。 本教程将引导您逐步创建自己的插件。
Try this one. This tutorial will take you step by step through creating your very own plugin.