jquery.live 的一个好的 yui 替代品是什么

发布于 2024-08-09 08:25:08 字数 233 浏览 2 评论 0原文

jQuery.live

在 jQuery 1.3 中添加:将处理程序绑定到所有当前和未来匹配元素的事件(如单击)。还可以绑定自定义事件。

http://docs.jquery.com/Events/live

有没有一个好的 YUI 替代品可以这样做吗?

jQuery.live

Added in jQuery 1.3: Binds a handler to an event (like click) for all current - and future - matched element. Can also bind custom events.

http://docs.jquery.com/Events/live

Is there a good YUI replacement which can do this?

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

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

发布评论

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

评论(1

等你爱我 2024-08-16 08:25:08

在 YUI3 中,委托执行此功能。以下代码片段将在正文中的任何“p”标记上触发名为“clickHandler”的方法。

YUI().use('event', function(Y) {
  Y.delegate("click", clickHandler, "body", "p");
});

YUI 2.8.0 也具有 委托 功能,但语法略有不同。

In YUI3, delegates perform this function. The following snippet will fire a method called "clickHandler" on any 'p' tag in the body.

YUI().use('event', function(Y) {
  Y.delegate("click", clickHandler, "body", "p");
});

YUI 2.8.0 has delegate functionality as well, but the syntax is slightly different.

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