Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery UI event and ui object properties

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?

like image 470
zgirod Avatar asked Sep 11 '10 16:09

zgirod


People also ask

What is event and UI in jQuery?

The event object is the original object that was fired, normalized by jQuery. Meanwhile, the ui object contains information added by jQuery UI, depending on which interaction was used. Depending on whether you utilized the properties in either of these objects may be the reason why you passed the exercise.

Does jQuery have an event object?

jQuery's event system normalizes the event object according to W3C standards. The event object is guaranteed to be passed to the event handler. Most properties from the original event are copied over and normalized to the new event object.

What is event object in jQuery?

jQueryWeb DevelopmentFront End Technology. The callback function takes a single parameter; when the handler is called the JavaScript event object will be passed through it.

Which property of the jQuery event object references the DOM object that dispatched an event?

The target event property returns the element that triggered the event.


2 Answers

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:

alt text

like image 68
Yi Jiang Avatar answered Oct 03 '22 06:10

Yi Jiang


this is a link for the 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/

like image 24
trrrrrrm Avatar answered Oct 03 '22 06:10

trrrrrrm