javascript - 根据用户鼠标是否在 iframe 窗口上方转义 iframe

标签 javascript css iframe

如果看到显示的 iframe 窗口则没有问题,但如果 iframe 窗口设置为 0px X 0px 只是为了隐藏 iframe 但加载它,然后重定向 iframe 或根本不显示它。

此外,如果在 iframe 或 frame 中加载了某些内容,通常如何才能将其断开?我会使用 javascript。

最佳答案

使用 window.clientWidthwindow.clientHeight 检查窗口的大小。如果它太小,使用 top.location = self.location.href 突破。

关于javascript - 根据用户鼠标是否在 iframe 窗口上方转义 iframe,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5525870/

相关文章:

javascript - YouTube JavaScript Player API seekTo()不可靠

javascript - SerializeArray 表行包含输入和/或文本。如何?

jquery - Skrollr 不能在 wordpress 中工作

javascript - js 样式不起作用

javascript - 将标签和标记对齐在同一垂直线上(Highcharts)

javascript - 如何使用 Datatable 以 POST 类型传递请求正文数据以使用 Javascript 进行服务器端分页

html - Chrome 中的 CSS 缓存问题

javascript - 字体系列 iFrame 正文

javascript - 如何访问跨域iframe内容? (上传文件跨域)

javascript - 如何确定网页是在 iframe 内加载还是直接加载到浏览器窗口中?