Try: $(document).ready(function() { // JQUERY stuff goes here //$('div#menu').hide(); $('#testlink').click(function() { $(this).hide(); }); }); OR $(document).ready(function() { // JQUERY stuff goes here //$('div#menu').hide(); $('#testlink').click(function() { $('#testlink').hide(); }); });
--- On Thu, 11/6/08, Warren <[EMAIL PROTECTED]> wrote: From: Warren <[EMAIL PROTECTED]> Subject: [jQuery] Re: Can't figure out why click function won't work for lifeimage To: "jQuery (English)" <jquery-en@googlegroups.com> Date: Thursday, November 6, 2008, 4:21 PM Anyone? I would think it's something rather easy that I'm missing. On Nov 6, 2:07 pm, Warren <[EMAIL PROTECTED]> wrote: > It doesn't work when the image is inside an <a> tag and using the id > of the a tag to make it disappear, like so: > > $(document).ready(function() { > // JQUERY stuff goes here > //$('div#menu').hide(); > $('#testlink').click(function() { > $(lifeimage).hide(); > }); > }); > > And in the HTML: > > <div id="top_link"> > <a href="#" id="testlink"><img src="images/top_menu_01.png" > id="lifeimage" style="width:74px;height:34px;border:1px solid green;" > alt="Life Menu" /></a> > > </div> > > On Nov 6, 1:59 pm, ripple <[EMAIL PROTECTED]> wrote: > > > I just noticed that I mixed up the divs by suggesting advertise. > > > > Save yourself the hassle and wrap the img tag in a link and us the link for the click. > > > > A browsers assigned nature is that an img is not clickable without another element(ie, href). > > > > > --- On Thu, 11/6/08, Warren <[EMAIL PROTECTED]> wrote: > > > From: Warren <[EMAIL PROTECTED]> > > Subject: [jQuery] Re: Can't figure out why click function won't work for lifeimage > > To: "jQuery (English)" <jquery-en@googlegroups.com> > > Date: Thursday, November 6, 2008, 1:51 PM > > > If I use some images on the page it works, and then others do not. I > > know img tags can be clickable - and I'm using firefox to test at the > > moment. > > > On Nov 6, 1:41 pm, ripple <[EMAIL PROTECTED]> wrote: > > > > An image can't be clickable in, if I remember IE? > > > > > > Change the click to the div "advertise" > >