javascript - JQuery:如何将事件连接到 iFrame 滚动

标签 javascript jquery iframe

我正在尝试附加一个事件,以便在滚动 iFrame 时触发

尝试过这些但没有运气

$('#iframeid').on('scroll', function(){...});

$('#iframeid').contentWindow.on('scroll', function(){...});

$('#iframeid').contents().find('body, html').on('scroll', function(){...});

我正在使用 AngularJs 和 JQuery。

最佳答案

正如评论中提到的,以下内容可以解决问题

$('#iframeid').contents().scroll(function(){
 // code here
});

关于javascript - JQuery:如何将事件连接到 iFrame 滚动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24112583/

相关文章:

javascript - 创建元素后滚动到页面底部

javascript - 将代码包装在一个函数中。菜鸟在这里

javascript - iframe 仅在 IE8/9 中显示垂直滚动条

javascript - 使用 HTML 4.01 文档类型嵌入内容(iframe)?

javascript - 如何获取嵌入的 YouTube 视频以自动播放建议的视频?

javascript - 使用AJAX : Send variables to a PHP file which generate XML from a Database

javascript - bootstrap-wysihtml5 不工作

javascript - Moment.js 以秒为单位动态更新时间

javascript - 延迟ajax成功,jQuery

javascript - 在angularjs中将base64图像数据转换为图像文件