javascript - 具有广泛主要内容的基础 Canvas 外滚动条和内容显示

标签 javascript jquery css zurb-foundation-6

当主要显示区域中的内容过宽时,我在尝试使用 Foundation 6.2.0 的 Off-Canvas 功能时遇到了问题。在大多数情况下,内容会换行,但如果您要显示无法换行的内容(例如表格或图像),我希望屏幕底部的水平滚动条允许我横向滚动以显示其余内容。

这好像不是,那个内容是隐藏的。

此外,如果主面板的内容超出屏幕,并且您使用的是从屏幕右侧滑入的偏移 Canvas ,则此面板的内容会隐藏在主面板的覆盖层中滑动右侧面板打开面板。

我已经 linked a JSFiddle showing this problem因为它呈现为我在浏览器中看到的样子。我无法让 Stack Overflow 代码运行器正常工作。使用底部的滚动条和“向右”按钮显示这两个问题。

有谁知道当主容器的内容比屏幕宽且无法换行时如何让 Foundation 适应布局?

$(document).foundation();
<div class="off-canvas-wrapper">
  <div class="off-canvas-wrapper-inner" data-off-canvas-wrapper>

    <div class="off-canvas position-left" id="offCanvasLeft" data-off-canvas>abcd</div>
    <div class="off-canvas position-right" id="offCanvasRight" data-off-canvas data-position="right">abcd</div>

    <div class="off-canvas position-top" id="offCanvasTop" data-off-canvas data-position="top">top</div>
    <div class="off-canvas-content" data-off-canvas-content>
      <div class="wrap">
        <main>
          <aside>

            <br/>
            <br/>
            <br/>
            <button type="button" class="button" data-toggle="offCanvasLeft">Left</button>
            <button type="button" class="button" data-toggle="offCanvasRight">Right</button>
          </aside>

          <article style="overflow-x:scroll;overflow-y:auto;">
            <div class="row" id="primary_nav">
              <p>Title</p>
            </div>
            <div class="row" id="secondary_nav">
              <div class="large-12 columns">
                <div>
                  <ul>
                    <li><a href="#/menu1" class="active">Menu1</a></li>
                    <li><a href="#/menu2">Menu2</a></li>
                    <li><a href="#/menu3">Menu3</a></li>
                  </ul>
                </div>
              </div>
            </div>
            <div class="row">
              <div class="large-8 columns" id="container">


                <table style="width:5000px;">
                  <tr>
                    <td>
                      This is an example of a page which shows the Foundation off-canvas behavior. Only it contains content which exceeds the horizontal with of the display. I'd expect the scroll-bar at the bottom of the pane to match the content of the middle panel so tha
                      scrolling would reveal the content. I'd also expect sliding the right panel out to adjust for the extended width of the center panel. This doesn't seem to be the case.
                    </td>
                  </tr>
                </table>

                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow
                <br/>efwpihfgwofgwofgogfow3gfow


              </div>
            </div>
          </article>

        </main>
      </div>

    </div>
  </div>
</div>

   

最佳答案

在 css 中为类 .wrap 添加 overflow:auto; 并删除 style="overflow-x:scroll;overflow-y:auto;" 来自 html 中的 article 标签。我希望这会有所帮助。

关于javascript - 具有广泛主要内容的基础 Canvas 外滚动条和内容显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36871618/

相关文章:

javascript - AngularJS 中的 HTTPS 'GET'

javascript - 关于 web worker 同步请求的看法

jquery - 使用 javascript 模数通过 for 循环遍历文本 slider

javascript - 根据变量名称将变量设置为已存在的变量

html - CSS 文本转换不将大写字母发送到业务层

css - 溢出在我的网站上不起作用

javascript - 如何发出 PUT API HTTPS 请求 [reactJS]

jQuery when().then() 在 AJAX 调用期间显示加载

javascript - 使主要内容在移动屏幕上占据全宽

javascript - 在 Appcelerator 中自动滚动到 View 末尾