Detect Document Height Change

后端 未结 8 1101
独厮守ぢ
独厮守ぢ 2020-12-04 10:07

I\'m trying to detect when my document height changes. Once it does, I need to run a few functions to help organize my page layout.

I\'m not looking fo

8条回答
  •  误落风尘
    2020-12-04 11:01

    Just my two cents. If by any chance you're using angular then this would do the job:

    $scope.$watch(function(){ 
     return document.height();
    },function onHeightChange(newValue, oldValue){
     ...
    });
    

提交回复
热议问题