<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
div {
width: 200px;
height: 200px;
background-color: red;
overflow-y: scroll
}
</style>
</head>
<body>
<div id="div1">
<div style="height: 100px;"></div>
<div style="height: 100px;"></div>
<div style="height: 100px;"></div>
</div>
<small class="more"></small>
<script>
var odiv = document.getElementById('div1')
console.log(odiv.scrollTop);
// $("#div1").scroll(function () {
// var nDivHight = $("#div1").height();
// nScrollHight = $(this)[0].scrollHeight;
// nScrollTop = $(this)[0].scrollTop;
// console.log(nDivHight);
// console.log(nScrollHight);
// console.log(nScrollTop);
// if (nScrollTop + nDivHight >= nScrollHight) {
// console.log("滚动条到底部了");
// } else {
// }
// })
odiv.onscroll=function(e){
console.log(odiv.scrollTop);
}
</script>
</body>
</html>