代码之家  ›  专栏  ›  技术社区  ›  Caterina

在R-markdown[duplicate]中折叠/隐藏多个图像

  •  1
  • Caterina  · 技术社区  · 6 年前

    我想做和这里完全一样的事情 Collapsing / hiding figures in R markdown ,但是我不想一个图像,而是希望一次折叠多个连续的图像(使用同一个按钮)。

    <input type=button class=hideshow></input>
    ![](images/1.png) ![](images/2.png) ![](images/3.png) ![](images/4.png) ![](images/5.png)
    
    <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>
    
    0 回复  |  直到 6 年前