【问题标题】:angular document height from top to bottom从上到下的角度文档高度
【发布时间】:2022-01-26 16:01:28
【问题描述】:

如何以角度计算从上到下的每个页面高度? 此语法在 JavaScript 中有效,但在 angular 中会出错

console.log( (document.height !== undefined) ? document.height : document.body.offsetHeight+'px');

【问题讨论】:

  • 你能显示 angular 给出的错误吗?

标签: angular typescript dom angular-material angular-dom-sanitizer


【解决方案1】:

试试这个:

console.log(window.innerHeight);

【讨论】:

  • 正如目前所写,您的答案尚不清楚。请edit 添加其他详细信息,以帮助其他人了解这如何解决所提出的问题。你可以找到更多关于如何写好答案的信息in the help center
猜你喜欢
  • 2020-09-16
  • 1970-01-01
  • 1970-01-01
  • 2012-01-01
  • 2018-06-05
  • 1970-01-01
  • 2016-03-21
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多