首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >覆盖效应对Chrome中iframe的影响而在IE11中不起作用

覆盖效应对Chrome中iframe的影响而在IE11中不起作用
EN

Stack Overflow用户
提问于 2017-03-30 06:49:10
回答 1查看 333关注 0票数 0

我有一个文档查看器,其中.less文件具有:

代码语言:javascript
复制
div.document-previewer-container {
//height: 400px;
//width: 300px;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
//padding: 5px 2px;
> div.document-preview {
    height: 88%;
    //width: 100%;
    position: relative;

    .document-container, .text-container, video, iframe, pre {
        height: 100%;
        width: 100%;
        position: relative;
    }

    .document-container > img {
        max-height: 100%;
        max-width: 100%;
    }

    .text-container pre {
        margin: 0;
        padding: 0;
    }

    .doc-overlay {
        width: 95%;
        height: 95%;
        position: absolute;
        cursor: pointer;
        top: 0;

        p {
            padding: 2px;
        }
    }
}
}

我的html是

代码语言:javascript
复制
<div class="document-previewer-container">
<div class="document-preview">
    <h3 ng-click="vm.openPDF()">yu</h3> <----- THIS CLICK IS WORKING
    <div class="document-container">
        <!-- PDF show in iframe -->
    </div>
    <div class="doc-overlay" ng-click="vm.openPDF()"> <---- THIS CLICK ISN'T becuse if is hidden by iframe
        <!-- any content is shown on the top of PDF file in chrome only, not in IE -->
    </div>
</div>
</div>
</div>

我的点击事件是在标记上工作的,但是当使用css类‘’点击div时就不行了。

如何处理?

我正在为IE11使用Foxit插件

Update1 我发现了this的问题,我认为这个问题发生在我身上。iframe是重叠的.doc-overlay,因此单击不起作用。对此有任何建议请

EN

回答 1

Stack Overflow用户

发布于 2017-03-30 07:41:00

实际上,这是一个CSS问题。您已经使用了SCSS格式,这就是为什么DOM无法找到类“”的原因。

你可以使用这个CSS,它会工作的很好。

代码语言:javascript
复制
div.document-previewer-container {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
div.document-previewer-container> div.document-preview {
    height: 88%;
    position: relative;
}
    div.document-previewer-container> div.document-preview .document-container, .text-container, video, iframe, pre {
        height: 100%;
        width: 100%;
        position: relative;
    }

    div.document-previewer-container> div.document-preview .document-container > img {
        max-height: 100%;
        max-width: 100%;
    }

   div.document-previewer-container> div.document-preview .text-container pre {
        margin: 0;
        padding: 0;
    }

   div.document-previewer-container> div.document-preview .doc-overlay {
        width: 95%;
        height: 95%;
        position: absolute;
        cursor: pointer;
        top: 0;
}
div.document-previewer-container> div.document-preview  .doc-overlay p {
       padding: 2px;
}

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43110506

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档