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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 15:55:13  来源:igfitidea点击:

jQuery UI event and ui object properties

jqueryjquery-ui

提问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 uiobject for draggableis available here: http://jqueryui.com/demos/draggable/. The event object is always the original event that is fired, while the uiobject 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.logon 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 uiobject looks like:

ui对象看起来像:

alt text

替代文字

回答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/