Will,

> Does anyone know of a way to use class like objects in event handling
> using jQuery?
>
> For Example,
>
> <input type='button' value='Button' onclick='Record.show()' />
>
> where .show() is a method of the Record object.  This would be really
> cool to be able to reuse the method name .show() but with different
> objects verses just coding a huge list of functions that are hard to
> organize and end up with long names.

You can always build objects around jQuery elements. Depending on your
needs, you might be able to get by with just caching your jQuery
objects:

Record = $("#some_div");

Now, Record:show() would show the record.

I generally find building full OO-based objects out of everything a
bit overkill, since the majority of operations your doing is just to
change the state of a DOM element (or elements.)

-Dan

Reply via email to