85
rated 0 times
[
92]
[
7]
/ answers: 1 / hits: 17255
/ 14 Years ago, fri, january 7, 2011, 12:00:00
I have a jQuery function where when an element is clicked a hidden div shows.
$('.openHide').click(function(){
$(this).next('.hiddenContent').toggle();
});
I need to modify it s that I could close this div if I click back not just on the first element. Possibly on Blur, but I am not sure how to indicate the element...
$('.hiddenContent').blur(function() {
$('.hiddenContent').parent().children('.hiddenContent').hide();
});
Here's my HTML:
<span class=openHide>text here</span>
<div style=display:none class=hiddenContent>
hidden content here
</div>
More From » jquery