I have been using the following script to collapse groupings in content query web parts. In another script used for collapsing web parts, it contained a SlideToggle function.
Can anyone assist me with adding the SlideToggle function to this script?
<style type="text/css">
.groupheader:before{
content:"+";
font-weight:bold;
padding-right:10px;
}
.minus:before{
content:"-";
font-weight:bold;
padding-right:15px;
}
</style>
</script>
<script type="text/javascript">
$(document).ready(function(){
$('.cbq-layout-main li ul').hide();
$('.cbq-layout-main ul li').click(function() {
$(this).closest('li').find('.groupheader').toggleClass('minus');
$(this).find('ul').toggle();
});
});
</script>
Here is the script I use for collapsing other web parts at the header:
<script type="text/javascript" >
jQuery(document).ready(function() {
jQuery(".ms-wpContentDivSpace ").hide();
//toggle the component with class msg_body
jQuery(".ms-webpart-chrome-title ").click(function()
{
jQuery(this).next(".ms-wpContentDivSpace ").slideToggle(500);
});
});
</script>