我正在尝试使用 YUI 绑定和触发以下事件,但是到目前为止,当我触发它们时似乎没有任何事件触发。
我要绑定的代码:
YUI().use('node-base', function(Y){
Y.one(el).on(event,callback);
});
我要触发的代码:
YUI().use('node-event-simulate', function(Y){
Y.one(el).simulate(event);
});
该event
变量可以是以下任何字符串:
statechange
(自定义事件)anchorchange
(自定义事件)hashchange
(有时是原生事件,取决于浏览器功能)popstate
(有时是原生事件,取决于浏览器功能)
el
变量通常是domwindow
元素,但也可能是选择器和其他 dom 元素。
这是我目前尝试让它在 YUI 中工作:http: //jsfiddle.net/balupton/tFbum/
这是我想要在 jQuery 中工作的内容:http: //jsfiddle.net/balupton/862Lg/
多谢你们 :-)