Try this: $('a.delete').click(function () { $(this).parent().hide('slow'); });
2008/11/6 evo <[EMAIL PROTECTED]>: > > C'mon guys, I posted this on monday and no one has any ideas/ knows > hows to help? > > On Nov 4, 8:44 am, evo <[EMAIL PROTECTED]> wrote: >> anyone? >> >> On Nov 3, 5:28 pm, Liam Potter <[EMAIL PROTECTED]> wrote: >> >> > Hi, >> > I'm having trouble figuring out how I can perform say, a hide animation >> > on adiv, by clicking a button on onediv, which uses aclassused by >> > other divs. >> >> > *Lets say I have this:* >> >> > <divclass="message"> >> > <a href="#"class="delete">Delete</a> >> > <p>Message text</p> >> > </div> >> >> > <divclass="message"> >> > <a href="#"class="delete">Delete</a> >> > <p>Message text</p> >> > </div> >> >> > <divclass="message"> >> > <a href="#"class="delete">Delete</a> >> > <p>Message text</p> >> > </div> >> >> > *then the jquery is: >> >> > *$("a.delete").click(function () { >> > $(".overlay").hide("slow"); >> > }); >> >> > This will hide all the messages, rather then the one I clicked the >> > delete button on. >> > Right now I'm using server side code to give eachdiva unique id, then >> > have the jquery like this >> >> > var inc = "<%#Eval("PrimaryKeyID")%>"; >> > $("a.delete"+ inc).click(function () { >> > $(".overlay").hide("slow"); >> > }); >> >> > This works, but it's not the best option, as I need to keep the JS >> > inline and I'd rather be able to seperate it into a .js file, and use it >> > in future projects just by writing the correct html then dropping the js >> > file in the head. >> >> > If anyone can show me the right way to do this, it would be extremely >> > helpful. >> >> > - Liam -- Rik Lomas http://rikrikrik.com