【问题标题】:iframe inside dijit/layout/contentpane does not have scrollbardijit/layout/contentpane 中的 iframe 没有滚动条
【发布时间】:2013-09-28 12:41:05
【问题描述】:

我在 dijit/layout/contentpane 中有一个 IFRAME。

当 Iframe html 呈现大于内容窗格大小时,或内容窗格中没有滚动条

使用溢出:自动没有帮助。
设置 iframe 的 scrolling=yes 会显示不起作用的滚动条。 当我设置 iframe 时,例如height=1000,则内容窗格会提供滚动条。 (问题是 iframe 声明事先不知道它将渲染的内容有多大,以便能够猜测/混合高度)

有什么建议吗?

【问题讨论】:

    标签: iframe dojo dijit.layout contentpane


    【解决方案1】:

    您最好发布您的代码,我在 ContentPane 中有一个 iframe,它可以正常工作。这是我的代码(重点是您需要将宽度和高度设置为 100%):

        var reportCP = new ContentPane({
            region: "center",
            className:"wpt-report-pane",
            content: put("iframe.wpt-iframe") // Here I use put-selector,you can use dojo.create as well
        }).placeAt(myBorderContainer);   
    

    还有 Css 类:

    .wpt-report-pane{
        background-color:#ddd;
    }
    
    .wpt-iframe{
        border: 0; 
        width: 100%; 
        height: 100%;
    }
    

    【讨论】:

    • 这里的关键肯定是width: 100%height: 100%:你需要确保你的内容总是填满ContentPane
    猜你喜欢
    • 1970-01-01
    • 2013-06-15
    • 2011-09-06
    • 1970-01-01
    • 2011-09-07
    • 1970-01-01
    • 1970-01-01
    • 2021-09-10
    • 1970-01-01
    相关资源
    最近更新 更多