我想做和这里完全一样的事情
Collapsing / hiding figures in R markdown
,但是我不想一个图像,而是希望一次折叠多个连续的图像(使用同一个按钮)。
<input type=button class=hideshow></input>
    
<script>
$( "input.hideshow" ).each( function ( index, button ) {
button.value = 'Hide Output';
$( button ).click( function () {
var target = this.nextSibling ? this : this.parentNode;
target = target = target.nextSibling.nextSibling;
if ( target.style.display == 'block' || target.style.display == '' ) {
target.style.display = 'none';
this.value = 'Show Output';
} else {
target.style.display = 'block';
this.value = 'Hide Output';
}
} );
} );
</script>