[jQuery] Re: multiple checkboxes showing/hiding a div

2008-12-18 Thread krozi...@gmail.com
thanks Dave and Ricardo! On Dec 18, 12:00 am, Ricardo Tomasi wrote: > var $check = $(':checkbox'); > $check.change(function(){ >    $('#special')[ $check.attr('checked') ? 'show' : 'hide' ]('slow'); > > }); > > that's essentially the same as > > $check.attr('checked') ? $('special').show('slow')

[jQuery] Re: multiple checkboxes showing/hiding a div

2008-12-17 Thread Ricardo Tomasi
var $check = $(':checkbox'); $check.change(function(){ $('#special')[ $check.attr('checked') ? 'show' : 'hide' ]('slow'); }); that's essentially the same as $check.attr('checked') ? $('special').show('slow') : $('special').hide ('slow'); (which is an if/else). And you don't need the IDs on t

[jQuery] Re: multiple checkboxes showing/hiding a div

2008-12-17 Thread Dave Methvin
> I have two checkboxes. When either one is checked, I would like to > show a div. When both are not checked, then I want the div hidden. I would just use a straight show/hide since the toggle conditions are unusual. Something like this should work but I haven't tried it. $("#check_1, #check_2