views:

10

answers:

1

Hi.

Most jQuery plugins have options like this one for example (cycle):

 $("ul").cycle({
    fx: 'fade',
    startingSlide: 1,
    speed: 500,
    pause: true});

The plugin will do his thing on all elements with the class/ID you specify, in this case all <UL> elements. How can I access this <UL>'s child elements from within one of these options.

For example startingSlide only accepts numbers, and I want to pass a function that returns a number, instead of just a number.

The problem is that within that function I don't know how to access the current <UL> the plugin is working with (not all ULs)

A: 

The plugin works only on the wrapped set that you specify eg $("ul"), if you want to something to happen to children of ul, you will have to specify that instead $("ul > li"). So the plugin will do its job on the wrapped set/selector you specify to it.

Sarfraz