每当调整浏览器窗口大小时,如何调用此(或任何)JS 函数再次运行?
<script type="text/javascript">
function setEqualHeight(e) {
var t = 0;
e.each(function () {
currentHeight = $(this).height();
if (currentHeight > t) {
t = currentHeight
}
});
e.height(t)
}
$(document).ready(function () {
setEqualHeight($(".border"))
})
</script>
最佳答案
您可以使用窗口onresize
事件:
window.onresize = setEqualHeight;
关于javascript - 调整窗口大小时调用函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15205609/