jQuery UI 事件和 ui 对象属性
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3691773/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
jQuery UI event and ui object properties
提问by zgirod
In the jQuery UI framework for Interactions you can do custom functions and they take two parameters 'event' and 'ui'. I know it has to be obvious somewhere but I cannot find out what methods and properties are available on those two parameters.
在用于交互的 jQuery UI 框架中,您可以执行自定义函数,它们采用两个参数“事件”和“ui”。我知道它必须在某处很明显,但我无法找出这两个参数可用的方法和属性。
Does someone know what methods and properties are available on those parameters or where I can I find them?
有人知道这些参数有哪些可用的方法和属性,或者我可以在哪里找到它们?
回答by Yi Jiang
The documentation is always a good place to start, for instance the stuff you find in the ui
object for draggable
is available here: http://jqueryui.com/demos/draggable/. The event object is always the original event that is fired, while the ui
object contains information added by jQuery UI.
文档始终是一个很好的起点,例如您在ui
对象中找到的内容可以在draggable
这里找到:http: //jqueryui.com/demos/draggable/。事件对象始终是被触发的原始事件,而该ui
对象包含由 jQuery UI 添加的信息。
If you want you can also do your own digging. Using console.log
on Firefox with the Firebug and Firequery add-ons, you can look at the insides of both objects. For instance, with this code:
如果你愿意,你也可以自己挖掘。使用console.log
火狐与萤火虫和Firequery的插件,你可以看看两个对象的内部。例如,使用此代码:
$('#test').draggable({
start: function(event, ui){
console.log(event);
console.log(ui);
}
});
The ui
object looks like:
该ui
对象看起来像:
回答by trrrrrrm
this is a link for the event object http://api.jquery.com/category/events/event-object/
这是事件对象的链接http://api.jquery.com/category/events/event-object/
for UI object it depends on the UI that you are using check this http://docs.jquery.com/UI/
对于 UI 对象,它取决于您使用的 UI 检查这个http://docs.jquery.com/UI/