Chrome 中的 iframe 滚动事件监听
所有,
我有两个图像(SVG),我想在 iframe 中“固定位置”。不幸的是固定位置的CSS属性在这里不起作用,所以我尝试用js来完成这个。
下面是监听 iframe 滚动运动的代码,我用它来移动 iframe 中的图像 (SVG)。不幸的是,这在 Chrome 中不起作用。请任何指导。
window.onload = function () { var f = document.getElementById("iframe_id").contentWindow; frm.onscroll = movef; }
function movef (evt) {
alert ("hello");
}
All,
I have two images (SVG) which I want to 'fixed position' in an iframe. Unfortunately the CSS property of fixed position does not work here, so am trying to accomplish this with js.
Here is the code which listens to the scroll movement of the iframe which I use to move the images (SVG) in the iframe. Unfortunately, this is not working in Chrome. Any guidance please.
window.onload = function () {
var f = document.getElementById ("iframe_id").contentWindow;
frm.onscroll = movef;
}
function movef (evt) { alert ("hello"); }
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
chrome 中的文档语言略有不同。
contentWindow 将是 chrome 中的 contentDocument
The document lang differs slightly in chrome.
contentWindow would be contentDocument in chrome