that's why I just rewrote it.

On Mar 19, 5:51 am, ricardobeat <ricardob...@gmail.com> wrote:
> The logic is all there in the source code. You can see that all of the
> fieldset's children get removed and appended to the DIV - that would
> include the first OL, that's why it doesn't work. This is just another
> wild guess, I can't test it:
>
>     var legend = fieldset.find(':first');
>     var body = fieldset.find('ol:first')
>
>     var children = fieldset.children(':not(ol:first)');
>     var len = children.length;
>     if(len > 1) {
>       for(i = 1; i < len; i++) {
>         body.append(children[i]);
>       } // for
>     } // if
>
> Maybe it would be simpler to write your own collapse function than
> adapt this plug-in, do you have a page with your html and js online?
>
> cheers,
> - ricardo
>
> On Mar 18, 4:25 pm, shapper <mdmo...@gmail.com> wrote:
>
> > Hi,
>
> > that is what I am trying to do but by using that plugin I can:
>
> > 1. Have different CSS classes applied to collapsed and expanded
> > fieldsets so I can get a toogle icons;
> > 2. Control the speed of collapse (this is not very important)
>
> > The problem is that the plugin, as far as I can see, gets all the
> > markup on the fieldset, places it inside a div and aplies the collapse/
> > expand to the div.
>
> > I would prefer the plugin to apply this to the ol, or even better, be
> > able to specify to which element in the fieldset should this be
> > applied (the collapase/expand) and the CSS classes.
>
> > I am not expert in JQuery but the plugin seems ok ... or no?
>
> > Thank You,
> > Miguel
>
> > On Mar 18, 6:17 pm, AnatolyG <anat...@geyfman.net> wrote:
>
> > > I don't have context for what you're trying to do, but if you want to
> > > hide the first OL that's displayed, then:
>
> > > fieldset.find("ol:eq(0)") finds it to hide it.
>
> > > but, if you just want this to be collapsable, and when clicking on the
> > > legend, uncollapse, wouldn't this be much easier?
>
> > >       $('fieldset').each(function(index, obj){
> > >         var $item = $(obj);
> > >         $item.find("legend").click(function(e){
> > >                 $item.find("ol:first").toggle();
> > >         });
> > >         $item.find("ol:first").hide();
> > >       });
>
> > > If you want to do something else, explain...
>
> > > A
>
> > > On Mar 18, 8:45 pm, shapper <mdmo...@gmail.com> wrote:
>
> > > > Sorry, I don't understand what your mean.
>
> > > > Please, check the code I am using 
> > > > in:http://www.27lamps.com/Beta/Collapse/JQuery.Collapsible-1.0.js
>
> > > > The change I am trying to do is in the following lines:
> > > >     var legend = fieldset.find(':first');
> > > >     var body = jQuery(document.createElement('div'));
> > > > //    var body = fieldset.find('ol:first')
>
> > > > On Mar 18, 2:12 pm, AnatolyG <anat...@geyfman.net> wrote:
>
> > > > > $("fieldset ol:eq(0)").hide()
>
> > > > > shapper wrote:
> > > > > > Hello,
>
> > > > > > I am trying to find update a plugin to create new functionality.
> > > > > > On the current version I have the following:
>
> > > > > >     var legend = fieldset.find(':first');
> > > > > >     var body = jQuery(document.createElement('div'));
>
> > > > > > - How can I get the first OL element inside fieldset to use it as 
> > > > > > body
> > > > > > instead of creating a new element (the div as it is currently?
>
> > > > > > - And can I set which element should be searched (ol, ul, div, etc)
> > > > > > inside the fieldset?
>
> > > > > > Thank you,
> > > > > > Miguel

Reply via email to