[jQuery] Re: how to the pass element to a plugin ?

2007-05-31 Thread Rob Desbois
Olivier, The following works fine for me: $(document).ready(function() { $("#top").children(".one, .two").each(function() { alert(this.id); }); }); Can you post your code? --rob On 5/31/07, Olivier Percebois-Garve <[EMAIL PROTECTED]> wrote: Hi rob It seems to m

[jQuery] Re: how to the pass element to a plugin ?

2007-05-31 Thread Olivier Percebois-Garve
Hi rob It seems to me that children() does not accept a params separated with a comma would that make sense ? On 5/31/07, Rob Desbois <[EMAIL PROTECTED]> wrote: Olivier, The .siblings() function excludes the elements selected, e.g.: $("#myId").siblings(); will select all siblings of the el

[jQuery] Re: how to the pass element to a plugin ?

2007-05-31 Thread Rob Desbois
Olivier, The .siblings() function excludes the elements selected, e.g.: $("#myId").siblings(); will select all siblings of the element with ID "myId", and will exclude that element from the results. --rob On 5/30/07, Olivier Percebois-Garve <[EMAIL PROTECTED]> wrote: Thanks a lot.I'll test

[jQuery] Re: how to the pass element to a plugin ?

2007-05-30 Thread Olivier Percebois-Garve
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] Re: how to the pass element to a plugin ?

2007-05-30 Thread Rob Desbois
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]> wrote: I dont get it working properly. I tr

[jQuery] Re: how to the pass element to a plugin ?

2007-05-30 Thread Olivier Percebois-Garve
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 is returning the object, wheras I need the selector name. the plugin should a

[jQuery] Re: how to the pass element to a plugin ?

2007-05-30 Thread Rob Desbois
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').accordionQu