Thanks a lot.I'll test that tomorrow back at work.It looks correct.
I never used children(), and its seems to solve issues I had on other scripts.

I also dream on a brothers() method (all other siblings except itself) ...

Olivier

Rob Desbois wrote:
Yes you're absolutely correct.

Try this:

    jQuery.fn.accordionQuizz = function(accordion) {
this.children('[EMAIL PROTECTED], label').each(function(){

I haven't tested it though.
--rob


On 5/30/07, *Olivier Percebois-Garve* < [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:

    I dont get it working properly. I tried:

      $('#accordion').accordionQuizz();

jQuery.fn.accordionQuizz = function(accordion){ jQuery(this+' [EMAIL PROTECTED], '+this+' label').each(function(){


    I guess that here <this> is returning the object,  wheras I need
    the selector name.
    the plugin should apply to to radio inputs and their labels within
    an element such as #accordion.

    Olivier



    On 5/30/07, *Rob Desbois* < [send email to [EMAIL PROTECTED]
    via gmail] [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>
    wrote:

        Olivier,

        If you call $(...).accordionQuizz() then the jQuery object
        (result of $(...)) is accessible via the 'this' object in your
        function:

            jQuery.fn.accordionQuizz = function(accordion) {

               alert(this.length); // use the jQuery object


        If you call that with:

            $('#accordion').accordionQuizz();

        then in your accordionQuizz() function, 'this' is the same as
        $("#accordion")

        --rob



        On 5/30/07, *Olivier Percebois-Garve* < [send email to
        [EMAIL PROTECTED] via gmail] [EMAIL PROTECTED]
        <mailto:[EMAIL PROTECTED]>> wrote:

            Hi

            I am calling my plugin this way :

                $().accordionQuizz('accordion');

            my plugin gets the param this way :

jQuery.fn.accordionQuizz = function(accordion){ jQuery(accordion+' [EMAIL PROTECTED],
            #'+accordion+' label').each(function(){


            How to do in order to call the plugin this way :

                $('#accordion').accordionQuizz();



            thanks


            Olivier




-- Rob Desbois
        Eml: [send email to [EMAIL PROTECTED] via gmail]
        [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
        Tel: 01452 760631
        Mob: 07946 705987
        "There's a whale there's a whale there's a whale fish" he
        cried, and the whale was in full view.
...Then ooh welcome. Ahhh. Ooh mug welcome.




--
Rob Desbois
Eml: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
Tel: 01452 760631
Mob: 07946 705987
"There's a whale there's a whale there's a whale fish" he cried, and the whale was in full view. ...Then ooh welcome. Ahhh. Ooh mug welcome.

Reply via email to