I've found examples where you can use a
selectors to have multiple divs expand/collapse, but haven't seen one with the use of an icon when collapsed and one when expanded.
How can I adjust the following so that it allows me to expand and collapse multiple divs? ie: if you open one it won't open ALL the others.
<!-- HTML -->
<a href="#" class="show_hide">Show</a>
<div class="slidingDiv" style="display: block;">
Check out
</div>
<!-- CSS -->
.show_hide{
background:url(http://img37.imageshack.us/img37/1127/plusminus.png) no-repeat;
padding-left:20px;
}
<!-- JS -->
$(document).ready(function(){
$(".slidingDiv").hide();
$('.show_hide').click(function(){
$(".slidingDiv").slideToggle();
var isShow = $(this).text() == 'Show';
$(this).text(isShow ? 'Hide' : 'Show').css({backgroundPosition:'0 '+ (isShow?-18:0) +'px'});
});
});