> -----Original Message-----
> From: Karl Swedberg [mailto:[EMAIL PROTECTED] 

> Forgive me if you've already posted it, but would you mind 
> showing us the HTML? Labels can wrap around an input, but 
> they don't have to, so seeing what the relationship is 
> between the label and the input (checkbox) would help tremendously.

Karl - I've refactored this a bit after finding your show/hide example
on learningjquery.com:

HTML
==============================================
<div class="demo-show">
<cfoutput query="qryTopics" group="category">
        <h3 class="right">#qryTopics.category#</h3>
        <div class="details">
        <cfoutput group="topic">
                        <div>
                        <label class="label"
for="topic_#qryTopics.topicid#"><input type="checkbox"
value="#qryTopics.topicid#" name="topic_#qryTopics.topicid#"
id="topic_#qryTopics.topicid#">
                        #qryTopics.topic#</label></div>
        </cfoutput>
        </div>
</cfoutput>
</div>


jQuery
==============================================
<script type="text/javascript">
        $.fn.extend({
                scrollTo : function(speed, easing) {
                return this.each(function() {
                        var targetOffset = $(this).offset();
                        $('html,body').animate({scrollTop:
targetOffset}, speed, easing);
                });
                }
        });

        $(document).ready(function() {
                $('div.demo-show:eq(0)> div:gt(0)').hide();
                $('div.demo-show:eq(0)> h3').click(function() {
 
$(this).removeClass('right').addClass('down').siblings('h3').removeClass
('down').addClass('right');
        
$(this).next('div:hidden').slideDown('fast').siblings('div:visible').sli
deUp('fast');
                        $(this).scrollTo(1000);
                });
        });
</script>

Now all I'd like to do is when the divs collapse - if there are checked
items within it - keep them visible...

Jim

Reply via email to