Thanks for your help but this is still not working. All that happens
is as soon as I click the word to make the div appear, it fades out
again.

I'm probably being totally thick here and missing something really
simple but I just cannot figure it out. All I need is for the div to
appear when clicking the link and to disappear when clicking out of
it.

This is how I make it appear:

$('a').click(function(e){
var x = $('#FM_OPTIONS').css( {
                'left' : e.pageX - 100,
                'top' : e.pageY + 35
                } );

        x.show();
});

which works.

I tried just a simple test:

$('body').click(function(){
        $("#FM_OPTIONS").fadeOut('fast');
});

and even that doesn't do anything. I tried implementing the :not()
selector by saying "if it's not an <a> tag" but I don't think that's
what it's actually for. I hope someone can come up with a working
solution - I would really appreciate it.

Thanks.


On Aug 17, 8:18 pm, Ricardo <ricardob...@gmail.com> wrote:
> return false; in your <a>'s click handler should avoid that, as it
> prevents the event from bubbling to the body. You can also check
> visibility:
>
> $().click(function(){
>     var opt = $(#'fm_options');
>     if( this != opt[0] && opt.is(':visible') )
>       opt.fadeOut('fast');
>
> });
>
> On Aug 17, 6:27 am,MiKiTiE<mikiji...@googlemail.com> wrote:
>
> > Thanks for your reply.
>
> > This is pretty much what I want - except I need my div to appear when
> > a particular link is clicked, but since I've put the fire in the body,
> > it's basically doing the fadeOut on every click (which stands to
> > reason since everything is the body!) So really what I need is
> > something else in there that says if it's also NOT an <a> tag...but
> > I'm pretty sure that if the <a> tag is clicked it will recognise it as
> > the body still? Is there some kind of work around for this?
>
> > Thanks
> > Mike
>
> > On Aug 14, 5:42 pm, Wolf <ventas.w...@gmail.com> wrote:
>
> > > hi you have ask if the id is different, then dissappear the div o
> > > element
>
> > > $("body").click(function(){
> > >     IF($(this).attr('id') !="FM_OPTIONS")
> > >     {
> > >       $("#FM_OPTIONS").fadeOut('fast');
> > >     }
>
> > > });

Reply via email to