jQuery UI事件和ui对象属性 [英] jQuery UI event and ui object properties

查看:120
本文介绍了jQuery UI事件和ui对象属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在互动的jQuery UI框架中,您可以执行自定义函数,它们使用两个参数event和ui。我知道它必须在某个地方很明显,但是我找不到这两个参数可以使用哪些方法和属性。



有人知道那些可用的方法和属性参数或我可以在哪里找到他们?

解决方案

文档始终是一个很好的开始的地方,例如你发现的东西在 ui 对象 draggable 可以在这里: http://jqueryui.com/demos/draggable/ 。事件对象始终是被触发的原始​​事件,而 ui 对象包含由jQuery UI添加的信息。



如果你想要也可以自己挖掘。在Firefox上使用Firebug和Firequery加载项使用 console.log ,您可以查看这两个对象的内部。例如,使用以下代码:

  $('#test')。draggable({
start:function event,ui){
console.log(event);
console.log(ui);
}
});

ui 对象看起来像: p>


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.

Does someone know what methods and properties are available on those parameters or where I can I find them?

解决方案

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.

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:

$('#test').draggable({
    start: function(event, ui){
        console.log(event);
        console.log(ui);
    }
});

The ui object looks like:

这篇关于jQuery UI事件和ui对象属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆