在div上找到scrollTop的最大底值? [英] Finding the maximum bottom value of scrollTop on a div?

查看:332
本文介绍了在div上找到scrollTop的最大底值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一种方法来自动查找div ID为"#box"的scrollTop的最大底值.

I need a way to automatically find the maximum bottom value of scrollTop, of the div id "#box".

类似这样的内容:如何获取最大的文档scrolltop值

,但仅位于div中,而不是整个浏览器窗口中. 我该怎么办?

but just in a div, not the whole browser window. How can I do this?

推荐答案

您要去的地方:

var trueDivHeight = $('.someclass')[0].scrollHeight;
var divHeight = $('.someclass').height();
var scrollLeft = trueDivHeight - divHeight;
alert(scrollLeft);

简体

这篇关于在div上找到scrollTop的最大底值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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