[jQuery] Re: hiding checkbox AND label?

2007-11-16 Thread Karl Swedberg
SO CLOSE! What I really need - is when the div collapses - is to HIDE the unchecked items: Isn't that what this does? $(this).next('div:hidden').slideDown('fast').siblings('div:visible:not (:has(input:checked))').slideUp('fast'); It's showing the very next div, and then hiding any other

[jQuery] Re: hiding checkbox AND label?

2007-11-16 Thread trevorp
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

[jQuery] Re: hiding checkbox AND label?

2007-11-16 Thread Karl Swedberg
Hey Jim, I think I'm beginning to understand what you're trying to do here. I'm a little slow. ;-) When the user clicks on an h3, the following will happen: 1. all div.details with ALL checkboxes inside of them UNchecked will show all of their checkboxes (and labels) 2. all other unchecked

[jQuery] Re: hiding checkbox AND label?

2007-11-16 Thread Priest, James (NIH/NIEHS) [C]
-Original Message- From: Priest, James (NIH/NIEHS) [C] Last question - would it be possible to have it collapse the checkboxes both when you click on the parent H3 or any other H3 (as it does now)? That may not be possible but what do I know :) I'm going to show this as it is

[jQuery] Re: hiding checkbox AND label?

2007-11-16 Thread Priest, James (NIH/NIEHS) [C]
-Original Message- From: trevorp [mailto:[EMAIL PROTECTED] 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 Unintentional - it was an Outlook glitch on my part! For your reference, the other

[jQuery] Re: hiding checkbox AND label?

2007-11-16 Thread Priest, James (NIH/NIEHS) [C]
-Original Message- From: Karl Swedberg [mailto:[EMAIL PROTECTED] Sent: Friday, November 16, 2007 12:31 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: hiding checkbox AND label? I think I'm beginning to understand what you're trying to do here. I'm a little slow

[jQuery] Re: hiding checkbox AND label?

2007-11-16 Thread Priest, James (NIH/NIEHS) [C]
-Original Message- From: Karl Swedberg [mailto:[EMAIL PROTECTED] It's showing the very next div, and then hiding any other sibling div that does not have a checked input. I must be misunderstanding something. In the html snippet you provided, you had one checkbox per

[jQuery] Re: hiding checkbox AND label?

2007-11-16 Thread Priest, James (NIH/NIEHS) [C]
-Original Message- From: Karl Swedberg [mailto:[EMAIL PROTECTED] Isn't that what this does? $(this).next('div:hidden').slideDown('fast').siblings('div:vis ible:not(:has(input:checked))').slideUp('fast'); This is getting closer:

[jQuery] Re: hiding checkbox AND label?

2007-11-15 Thread Gordon
If your HTML is like this: labelLabel text hereinput type=checkbox //label then you can give the label an ID and hide that. label id=myLabel1Label text hereinput type=checkbox //label $('#myLabel1').hide (); If you're using the FOR attribute to hide then there are a few approaches. The

[jQuery] Re: hiding checkbox AND label?

2007-11-15 Thread Priest, James (NIH/NIEHS) [C]
-Original Message- From: Gordon [mailto:[EMAIL PROTECTED] Be aware there is a slight speed penalty for using classes instead of IDs, and there's a quite substantial speed penalty for using [] attribute matching instead of IDs or classes. For that reason I'd recommend using IDs

[jQuery] Re: hiding checkbox AND label?

2007-11-15 Thread Priest, James (NIH/NIEHS) [C]
-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

[jQuery] Re: hiding checkbox AND label?

2007-11-15 Thread Karl Swedberg
Hi Jim, First of all, feel free to change this selector to match some more meaningful HTML on your page: $('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.

[jQuery] Re: hiding checkbox AND label?

2007-11-15 Thread Priest, James (NIH/NIEHS) [C]
-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

[jQuery] Re: hiding checkbox AND label?

2007-11-15 Thread Priest, James (NIH/NIEHS) [C]
-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

[jQuery] Re: hiding checkbox AND label?

2007-11-15 Thread Priest, James (NIH/NIEHS) [C]
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] Re: hiding checkbox AND label?

2007-11-14 Thread Feijó
Try this $('h3').click(function() { $(this).next('.details').find(input:checkbox).not(:checked).parent().hide(); }); Feijó - Original Message - From: Priest, James (NIH/NIEHS) [C] [EMAIL PROTECTED] To: jquery-en@googlegroups.com Sent: Wednesday, November 14, 2007 4:56 PM

[jQuery] Re: hiding checkbox AND label?

2007-11-14 Thread Karl Swedberg
Hi Jim, 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. Thanks, --Karl _ Karl