35
rated 0 times
[
42]
[
7]
/ answers: 1 / hits: 21025
/ 15 Years ago, mon, november 9, 2009, 12:00:00
I have some HTML that looks like this:
<div>
<div class=value>
<a href=# class=clicker>Some Value</a>
</div>
<div class=heading>
Some Name<img src=loading.gif style=visibility:hidden>
</div>
</div>
This could repeat several times, depending on how many values and headings need to be listed. Using jQuery, I've attached a function to happen when the a.clicker is clicked. As a part of what happens, I'd like to call show() on the .heading img below it. However, I just can't get my head around how this is supposed to be selected.
$('a.clicker').live(click, function() {
// This next line, in my brain, works, but in reality it doesn't!
$('.heading img', $(this).parent().parent()).show();
// do some other AJAXy things
});
I've marked the line that I think should do it, but it's not showing the img at all. I've been poring over the documentation and soflow for a couple of hours without success.
Thanks for any assistance!
More From » jquery