0
我無法獲取呈現元素的高度。它返回null。我需要元素來檢查它自身的高度,而不需要用戶交互。AngularJS - 無法獲取元素的高度
HTML
<span ng-if="contentHeight($element)" ></span>
JS
$scope.contentHeight = function(element){
console.log($(element).height());
return true;
};
您的元素實際上是否顯示?測量不可見的元素有點棘手。 – 2014-09-24 13:12:25
$ element從哪裏來,試圖記錄$(元素)? – graphefruit 2014-09-24 13:12:41
@Bartdude是顯示 – user1477955 2014-09-24 13:13:56