Thanks for the info. Will the window bind work for me?
My understanding is that with "window bind" a click anywhere
(including the pop-up layer) will make the layer disappear. How would
I exclude my pop-up layer from disappearing?
On Aug 23, 12:10 pm, "Benjamin Sterling"
<[EMAIL PROTECTED]> wrote:
> If you are trying to set it to disappear once the user "clicks" on something
> else, you can do $(window).bind('click',function(){//your code});
>
> but if you doing something like, the user clicks button to bring layer up
> then the mouseout of the button or the layer, the layer disappears. You
> will need to do a set timeOut
>
> var myTimeOut;
>
> $('button').click(function(){
> //code to show layer})
>
> .mouseout(function(){
> myTimeOut = setTimeout(function(){//code to hide layer}, 1000);})
>
> .mouseover(function(){
> clearTimeOut(myTimeOut);
>
> })
>
> $('.myLayer').mouseover(function(){
> clearTimeOut(myTimeOut);})
>
> .mouseout(function(){
> myTimeOut = setTimeout(function(){//code to hide layer}, 1000);
>
> })
>
> Try that, it is untested but should point you in the right direction.
> On 8/23/07, gr00vy0ne <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > jquery newbie (more designer than programmer) here...
>
> > I have a button on my page that triggers (via hover) a layer pop-up. I
> > currently have the layer pop-up disappearing once a user takes action
> > within the layer but I would like the layer to disappear if the user
> > clicks anywhere else on the page.
>
> > I can't seem to figure out the best jquery function that would best
> > handle this.
>
> > Right now, my current line of thinking is something like the
> > following:
>
> > // while hovering over the popped up layer stay visible
>
> > $(".popup_layer").hover(function () {
> > $(".popup_layer").show();
> > },function() {
> > ...
> > });
>
> > Any thoughts or direction?
>
> --
> Benjamin Sterlinghttp://www.KenzoMedia.comhttp://www.KenzoHosting.com