On Aug 20, 2008, at 2:47 PM, garrettjohnson wrote:
I have a series of articles like so...
[p] bla bla bla bla [/p]
[a class="read-more"] read more [/a]
[p class="my-hidden-content] bla bla bla [/p]
Now what i would like to do is just on an anchor and show the review,
but obviously with my code it will show all of hidden classes.. How
would i narrow it down to just the one desired one ?
$('.read-more').click(function(){
$('my-hidden-content').slideDown('slow');
});
To narrow it down to the desired one, make use of the "this" keyword:
$('.read-more').click(function(){
$(this).next().slideDown('slow');
return false; // <-- this is necessary, too, to prevent the
link's default action
});
--Karl
____________
Karl Swedberg
www.englishrules.com
www.learningjquery.com