[jQuery] Re: Hide/Close div when clicked outside of it.

2008-06-05 Thread vincent voyer
(); } return false; }) -- ADD SEMICOLON HERE -- Josh - Original Message - From: Aleksandr [EMAIL PROTECTED] To: jQuery (English) jquery-en@googlegroups.com Sent: Friday, May 02, 2008 11:00 AM Subject: [jQuery] Re: Hide/Close div when clicked

[jQuery] Re: Hide/Close div when clicked outside of it.

2008-05-02 Thread Aleksandr
I was try to do in this way. But it also close div clicking inside of it. So, if I click in wrapper area it close divLoginBox1. But if I clicked divLoginBox1 area it close it also. Should be the way how exclude divLoginBox1 area from wrapper div. This line not help to do it:

[jQuery] Re: Hide/Close div when clicked outside of it.

2008-05-02 Thread Jimslam
So the other option is to have the wrapper not contain the divLoginBox1 so that clicking inside of divLoginBox1 would not be clicking inside of wrapper. Just be sure to set the z-index on divLoginBox1 higher. On May 2, 4:21 am, Aleksandr [EMAIL PROTECTED] wrote: I was try to do in this way.

[jQuery] Re: Hide/Close div when clicked outside of it.

2008-05-02 Thread Aleksandr
z-index of divLoginBox1 is higher than wrapper div. On May 2, 3:52 pm, Jimslam [EMAIL PROTECTED] wrote: So the other option is to have the wrapper not contain the divLoginBox1 so that clicking inside of divLoginBox1 would not be clicking inside of wrapper. Just be sure to set the z-index on

[jQuery] Re: Hide/Close div when clicked outside of it.

2008-05-02 Thread sawmac
try this $('#divLoginBox1').click(function(e) { e.stopPropagation(); }); $(document).click(function() { $('#divLoginBox1').hide(); }); --dave

[jQuery] Re: Hide/Close div when clicked outside of it.

2008-05-02 Thread Aleksandr
I am now have this jQuery code and it is working in FireFox, Safari and Opera but not in IE 6, 7: $(document).ready(function(){ $(#link).click(function(){ if ($(#divLoginBox1).is(':hidden')) $(#divLoginBox1).show(); else{

[jQuery] Re: Hide/Close div when clicked outside of it.

2008-05-02 Thread Josh Nathanson
-- Josh - Original Message - From: Aleksandr [EMAIL PROTECTED] To: jQuery (English) jquery-en@googlegroups.com Sent: Friday, May 02, 2008 11:00 AM Subject: [jQuery] Re: Hide/Close div when clicked outside of it. I am now have this jQuery code and it is working in FireFox, Safari

[jQuery] Re: Hide/Close div when clicked outside of it.

2008-05-02 Thread Aleksandr
-- Josh - Original Message - From: Aleksandr [EMAIL PROTECTED] To: jQuery (English) jquery-en@googlegroups.com Sent: Friday, May 02, 2008 11:00 AM Subject: [jQuery] Re: Hide/Close div when clicked outside of it. I am now have this jQuery code and it is working in FireFox, Safari

[jQuery] Re: Hide/Close div when clicked outside of it.

2008-05-01 Thread Aleksandr
I still have the same issue. Yes, I have wrapper div how it can be solved in this case? Thanks On Apr 30, 7:05 pm, Wes Duff [EMAIL PROTECTED] wrote: Off the top of my head --- Try something like this $('div#mydiv').clcik(function(){$('div#mydiv').show();}); //click to show div

[jQuery] Re: Hide/Close div when clicked outside of it.

2008-05-01 Thread Wes Duff
Let me see if I have this clear. Once I do I will write you up a script. When someone clicks a link a href=#Show Login Box/a you want to display a div that shows the login box. When someone clicks somewhere else on the screen and not on the link you want to hide the login box? On May 1, 5:08

[jQuery] Re: Hide/Close div when clicked outside of it.

2008-05-01 Thread Aleksandr
Yes you right. Also I have close link inside of the div. Everything is working, only outside click left. On May 1, 3:08 pm, Wes Duff [EMAIL PROTECTED] wrote: Let me see if I have this clear. Once I do I will write you up a script. When someone clicks a link a href=#Show Login Box/a you

[jQuery] Re: Hide/Close div when clicked outside of it.

2008-05-01 Thread Jimslam
The Easiest method would be to create a wrapper div that takes up the entire screen and assign an onClick event to that, which would then contain the other div. For example: div id=wrapper div id=divLoginBox1 Login box content /div /div The CSS for the DIV id=wrapper would be

[jQuery] Re: Hide/Close div when clicked outside of it.

2008-04-30 Thread Wes Duff
Off the top of my head --- Try something like this $('div#mydiv').clcik(function(){$('div#mydiv').show();}); //click to show div $('div:not(#mydiv)').click(function(){$('div#mydiv').hide()}); click anywhere else to hide div ## Problem just thought of If you are using a wrapper div then you will