Now that you mention, I used another approach for external
manipulation, implemented in SerialScroll.
I expose many custom events, that are to be triggered on the
container, some accept/require arguments, some don't.

Using events allows one to have "protected" data, meaning, local
variables that were generated within a specific call to the plugin,
can be exposed but not in a public way.
This avoids relying too much on $.data, internally, which can be
tedious and slow.

If you want to read some more, check SerialScroll's documentation,
specifically, the section named "External manipulation, event
triggering".
  http://flesler.blogspot.com/2008/02/jqueryserialscroll.html

Cheers

--
Ariel Flesler
http://flesler.blogspot.com

On 9 abr, 10:11, Klaus Hartl <[EMAIL PROTECTED]> wrote:
> On Apr 9, 4:49 am, oravecz <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > The jQuery tabs plugin demonstrates one approach, but it seems less
> > efficient. Using Mike's example, highlighting would be added to DOM
> > objects using:
>
> >     jQuery('.targets').hilight();
>
> > And any external API calls are made through the same interface:
>
> >     jQuery('.targets').hilight('enableEffect', false);
>
> > The tabs plugin accomplishes this by keeping track of whether the
> > object has been jQueried previously. If it has and the first parameter
> > is a string, it invokes the method. The methods that are invoked are
> > added to the new object's prototype. It's a bit awkward.
>
> > Is this the preferred way of achieving this? I haven't seen too many
> > examples of jQuery plugins that, once applied, can be further
> > manipulated by a callable API.
>
> This is what we decided upon as a unified API for *all* jQuery UI
> components... But the pattern of method overloading is pretty common
> throughout jQuery in general.
>
> There has been a very long discussion about this - too much to repeat
> here -so if you're interested in the whys for that decision you should
> have a look at the jQuery development list.
>
> --Klaus- Ocultar texto de la cita -
>
> - Mostrar texto de la cita -

Reply via email to