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'); > > } > > > });