我有一些javascript代码,在选择菜单项时,pdf文件被加载到字段id = content。我还有一个固定的页眉和页脚。该代码适用于Chrome,Safari,Edge,Firefox和& Opera但IE11忽略了我已加载pdf的固定页眉和页脚(但不是我已经获得菜单的左侧)。
这是加载pdf的javascript:
document.getElementById('content').innerHTML = "<object id='provue_file' data='"+file_name+"#view=FitH' type='application/pdf' width='100%'><p>It appears you don't have Adobe Reader or PDF support in this web browser. <a href='"+file_name+"'>Click here to download the PDF</a>. Or <a href='http://get.adobe.com/reader/' target='_blank'>click here to install Adobe Reader</a>.</p></object>";
这里是页眉和页脚css声明:
div.header, div.footer {
padding: 0.5em;
color: blue;
background-color: honeydew;
clear: left;
}
.footer {
border-top:1px solid gray;
left:0;
bottom:0;
position: fixed;
width: 100%;
}
.header {
padding:0;
margin:0;
top:0;
left:0;
width: 100%;
position: fixed;
border-bottom:1px solid gray;
}
这是html声明的内容:
<div class="content" id="content">
</div>
请注意,在运行javascript之前,它在IE11中没问题