I have some html such as the following:
<div class="location">
<h3><a class="location_name" href="#">Beijing, China</a><a class="arrow">></a></h3>
<p class="blogentry">Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit</p>
</div>
and I want to be able to slide down the .blogentry when the .location_name is clicked. I am doing the following using jquery:
$(function(){
$(".location_name").click(function(eventObject){
$(this).parents(".location").find(".blogentry").slideToggle();
});
});
Is this the best way to do it? Would it be better if I laid out my html differently?
Thanks for your help
preventDefaaultotherwise your page will jump at the top forhref='#'