i have jquery accordion script like this..
<script type='text/javascript'>
$(document).ready(function() {
$('div.Syb> div').hide();
$('div.Syb> h4').click(function() {
$(this).next('div').slideToggle('fast')
.siblings('div:visible').slideUp('fast');
});
});
</script>
i need to show + and – symbol before the div ..to show that its expanded and collapsed..
how do i do it.?
If you’re not fussed about Internet Explorer 7 or less, then you can do this in CSS, which is where it should be ideally (as it is presentation, not content):
Or you could play around with background images.
Then just simply use
toggleClass()to give your div a .hidden class.If you want to do it in straight up jQuery, you’ll probably have to change your markup a little:
Then you can simply change your jQuery as such: