162
rated 0 times
[
165]
[
3]
/ answers: 1 / hits: 42464
/ 12 Years ago, tue, february 12, 2013, 12:00:00
I have a page that when a user clicks a title, the following div toggles display.
I want to somehow say if any other divs are display:block then set them to display none first.
I have the following...
$('.office-title').click(function(){
$(this).next('div').slideToggle();
return false;
});
and my html markup is as such...
<div class=office-row>
<h3 class=office-title>Title</h3>
<div class=office>sadasd</div>
</div>
<div class=office-row>
<h3 class=office-title>Title</h3>
<div class=office>sadasd</div>
</div>
<div class=office-row>
<h3 class=office-title>Title</h3>
<div class=office>sadasd</div>
</div>
More From » jquery