Jim,
  You started a new topic and abandoned your last one, not sure if
that was on purpose or not, but the code I pasted at the end of the
other topic seems to do exactly what you're asking for.  Like I said,
it's not necessarily elegant, but it does work.  I should have
probably copied your Topics 1, item 1, item 2 headings to make it more
meaningful, but I wrote it in a hurry, and forgot to go back and
change the words before I copied and pasted them in.

  For your reference, the other topic is located at:
http://groups.google.com/group/jquery-en/browse_thread/thread/f95d372a5bf258e0?hl=en

  Since I see you're a coldfusion programmer too, here's the cf code I
used to test this:

<script>
$(document).ready(
        function() {
                $('h3').click(function() {
                        $
(this).next().children('div').children(':checkbox').not(':checked').parent('div').toggle("fast");
                })
        });
</script>

<cfloop index="i" from="1" to="#randRange(2,5)#">
        <h3>
                Topics <cfoutput>#i#</cfoutput>
        </h3>
        <div>
                <cfloop index="j" from="1" to="#randRange(2,5)#">
                        <div>
                                <input type="checkbox" 
name="item_<cfoutput>#i#_#j#</cfoutput>">
item <cfoutput>#j#</cfoutput><br />
                        </div>
                </cfloop>
        </div>
</cfloop>

  Just copy and paste that into a page to test functionality.  The
only thing I omitted is the inclusion of your jquery library.

  -Trevor

On Nov 15, 3:36 pm, "Priest, James (NIH/NIEHS) [C]"
<[EMAIL PROTECTED]> wrote:
> Sorry - I hate Outlook...
>
>
>
> > > -----Original Message-----
> > > From: Karl Swedberg [mailto:[EMAIL PROTECTED]
>
> > > $('div.demo-show:eq(0) ...
>
> > > I doubt you'll need the :eq(0) part, and the "demo-show"
> > > class was for a demo, so you can safely change that in the
> > > HTML and match the change in the jQuery.
>
> > Yeah - I just wanted to keep it the same to make sure I wasn't messing
> > something up! :)
>
> > > $(this).next('div:hidden').slideDown('fast').siblings('div:vis
> > > ible:not(:has(input:checked))').slideUp('fast');
>
> > SO CLOSE!  What I really need - is when the div collapses - is to HIDE
> > the unchecked items:
>
> Topics 1
>  0 item 1
>  0 item 2
>  0 item 3
>
>  Topics 2
>  Topics 3
>
>  So user selects
>
>  Topics 1
>  x item 1
>  0 item 2
>  x item 3
>
>  Topics 2
>  Topics 3
>
> And then clicks Topics 2 they would see:
>
>  Topics 1
>  x item 1
>  x item 3
>
>  Topics 2
>  0 item 1
>  0 item 2
>  0 item 3
>  0 item 4
>
>  Topics 3
>
> Hope that makes sense...  This is really close - I'm going to tinker
> with it a bit but would love to hear your input!
>
> Jim

Reply via email to