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