0

should we include event,ui in the resize function every time we use resize so it looks like function(event, ui) instead of doing just function(). In what cases do we not include them in. And what exactly is ui.element. I can't find ui.element in the documentation.

$('div').live({
    resize: function(event, ui){
   var height = ui.element.height();
   $('#wrapper_size').text(height);
}

1 Answer 1

4

You can use them, when you need them. You use event if you want to know what was clicked, if maybe alt or ctrl key are pressed... ui is defined by the jquery ui element. If you are using chrome, do following

console.log(event);
console.log(ui);

and Chrome will give you the object in a nice graph where you can browse through, if you dont need it, you dont have to use it.

ui.element doesn´t exist anymore as I know. Here is some more info Why am I getting a jQuery 'ui.element is undefined' error?

Sign up to request clarification or add additional context in comments.

4 Comments

Great explanation. And what is ui.element. What is element
see my update about ui.element. Thanks for your acknowledgement
I don't ui.element is deprecated. I'm still able to use it in jquery 1.5 and ui 1.8.9.
element should be the selector element you were using to create the jquery ui element. $("element") == ui.element. it should be the same as "this" in the inner function. It would be used by the ui widget in some kind.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.