Sorry, should have been something like this:

$('body *').not(".div_color").click(function(){
        $(".div_color").hide();
});

or

$('*').not(".div_color").click(function(){
        $(".div_color").hide();
});


both untested, as always ;-)

-- Marc

Marc Jansen schrieb:
> Hi David,
>
> maybe this works:
>
> $('body').not(".div_color").click(function(){
>       $(".div_color").hide();
> })
>
>
> untested.
>
> -- Marc
>
>
> blemming schrieb:
>   
>> I'm trying to create a few drop down option menus that are contained in divs
>> which are initially not displayed.  There each have a image dropdown image
>> with class = div_color. Here is how I am opening the boxes and closing any
>> others that were left open.  
>>
>> $(".box_color").click(function ()
>>      {
>>              $(".div_color").hide();
>>              $(this).next().show();
>>      }       
>> )
>>
>> My question is how do I create an event that will hide() the divs if the
>> user clicks anywhere else on the screen?  I'm new to jQuery so I'm thinking
>> something along these lines might work but I don't know how to properly
>> write the css selector. 
>>
>> // DOESN"T WORK 
>> $('body:not(".div_color")').click(function(){
>>              $(".div_color").hide();
>>      }
>> )
>>
>> Thanks for your help! David
>>   
>>     
>
>
>   


-- 
========================

 Marc Jansen

  Reuterstraße 112
  53129 Bonn
  0228 / 2438694

  Schwalbenweg 2
  53947 Nett./Engelgau
  02486 / 7644

  [EMAIL PROTECTED]

========================


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to