What I need this to do is toggle .information when .info is clicked, at same time this hides all other .information divs. I can currently do this my problem is when i click to close an open .information div it won’t close. How can this following code be amended to do this? I have a toggle() so thought that it would work? Just grasping jQuery!!
<ol id="resonsToCome">
<li>
<p>A packed and extensive activites programe</p>
<div class="info">
<img src="images/icons/information.png" width="24" height="24" />
</div>
<div class="information">
<p>The 40+ activities range from 1 to 2 hours. As everything is on site there is no time wasted travelling which ensures up to 5/6 activities per day.</p>
</div>
</li>
<li>
<p>Instructors stay with their group throughout your stay</p>
<div class="info">
<img src="images/icons/information.png" width="24" height="24" />
</div>
<div class="information">
<p>Building a trust and friendship with our customers makes your stay memorable in so many ways.</p>
</div>
</li>
<li>
<p>Friendly and experienced instructors</p>
<div class="info">
<img src="images/icons/information.png" width="24" height="24" />
</div>
<div class="information">
<p>Our instructors take part in a rigorous selection and continuous training programme.</p>
</div>
</li>
<li>
<p>A great environment and perfect location!</p>
<div class="info">
<img src="images/icons/information.png" width="24" height="24" />
</div>
<div class="information">
<p>25 acres of beautiful Somerset fields, woodlands and river only 2 hours from London and 1 hour south of Bristol and Bath.</p>
</div>
</li>
</ol>
And the jQuery
$('div.info').on('click', function() {
$('.information').hide();
$(this).closest('ol#resonsToCome li').find('.information').toggle();
});
Being that you are hiding everything the toggle is just going to re-show the item that you want to be hidden. Try this