如何计算滚动内容的高度 [英] how to calculate height of scroll content

查看:42
本文介绍了如何计算滚动内容的高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 ionic-3 开发Hybrid应用.我想在页面中心显示垂直线,并且我的页面具有动态数据,因此我们无法设置此线的高度.我在下面的图片中显示了我的页面的视图.我已经把div设置为绝对,并给边框留了100%的高度,但是当我滚动行时不再.所以我只想计算滚动内容的高度,就可以动态设置它.让我知道您是否有更好的解决方案.

I'm developing Hybrid app using ionic-3. I want to display vertical line in center of the page and my page have dynamic data so we can't set height of this line. I have display view of my page in below image. I have put div and set as absolute and give border left with 100% height but when i scroll line is no longer. So i just want to calculate height to scroll content and i'll set it dynamically. Let me know if you have better solution for it.

谢谢.

推荐答案

对于此特定问题,还有其他解决方法.

For this specific issue there are some other ways to solve the issue.

1)您可以添加一个伪元素并将其绝对放置在包装容器中2)在其中添加一行背景.

1) You could add a pseudo element and position it absolute in the wrapping container 2) Add a background with a line in it.

这篇关于如何计算滚动内容的高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆