首页 > 解决方案 > 页面完全加载后,嵌入式 Outlook 365 日历会自动滚动到日历部分

问题描述

日历中有一些东西会强制它自动滚动到嵌入日历的页面部分。我该如何防止这种情况发生?有什么可以添加到 iframe 或 css 中的吗?或者也许有一个简单的javascript解决方案?

任何想法表示赞赏。

<div class="iframe-container">
  <iframe src="https://outlook.office365.com/owa/calendar/18c7a310a7a542c0863b9c2fa1c19bdf/calendar.html" allowfullscreen></iframe>
</div>

标签: javascripthtmloutlookcalendarembed

解决方案


添加style="display: none;" onload="this.style.display='block';"到 iframe 解决了这个问题。

<div class="iframe-container">
  <iframe style="display: none;" onload="this.style.display='block';" src="https://outlook.office365.com/owa/calendar/18c7a310a7a542c0863b9c2fa1c19bdf/calendar.html" allowfullscreen></iframe>
</div>

推荐阅读