Marc Thanks for your input.... Unfortunately, I can get it to function as I
would like.
I have:
$('*').not(".box_color").click(function(){
$(".div_color").hide();
});
$(".box_color").click(function (){
$(".div_color").hide();
$(this).next().show();
})
Where .box_color is the class assigned to the image that displays the
drop-down menu div with class .div_color. When I add your snippet of code
the click function that is supposed to show the clicked menu is not working.
(i.e. no menu is shown)
Thank you for your help. I'm trying to learn jQuery after spending a month
working with prototype!
Marc Jansen-2 wrote:
>
> 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/
>
>
--
View this message in context:
http://www.nabble.com/Help-with-drop-down-menus-tf2821960.html#a7878314
Sent from the JQuery mailing list archive at Nabble.com.
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/