When an element is scrolled, some or even all elements will be hidden. How to get the height of the visible part? Using clientHeight doesn't work, what should I do?
某草草2017-06-12 09:32:22
Do you mean the staircase effect? You can see the scrolling distance in the title
$(document).ready(function(){
$(window).scroll(function(){
// 获得窗口滚动上去的距离
var ling = $(document).scrollTop();
// 在标题栏显示滚动的距离,不需要注释掉
document.title = ling;
// 如果滚动距离大于660的时候让楼梯显示
if(ling>660){
$('.return_top').show();
}
}
typecho2017-06-12 09:32:22
Is it true that the clientHeight is not set for the parent container, the client is set for the visible area, the offset is set for the visible area with the scroll bar, and the scroll is set for the complete area
Here is an example for preview