javascript - 当我的 $ ('html' ) 使用 Jquery 调整大小时,如何触发函数

标签 javascript jquery html

我想知道如何在 $('html') 调整大小后立即使用 Jquery 触发函数。

我尝试过:

$('html').on('resize', executeThisFunction);

但看起来该事件仅在窗口元素上触发。

最佳答案

html 不会触发调整大小事件,但您可以查看监视 DOM 属性,或 plugin as described in this thread

window fire 确实有一个调整大小事件,这就是它工作的原因。

关于javascript - 当我的 $ ('html' ) 使用 Jquery 调整大小时,如何触发函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38874424/

相关文章:

javascript - 返回选项卡时触发功能

javascript - 打开和关闭固定div

php - for 循环只取 mysql 结果的第一个值

php - 解析错误: Help me solve my php error

javascript - 将Child追加到数组

javascript - Angular JS 是传统 jQuery AJAX 的替代品吗?

javascript - 对我的表单进行任何修改都会触发事件

javascript - 在 jQuery 中使用表中的升序和降序

javascript - 使用下拉菜单阻止页面加载

jquery - 结合使用 jQuery 和 AngularJS?