js 监听事件
Jquery滚动条监听
const scrollContainer = document.getElementById('ticket-records'); scrollContainer.addEventListener('scroll', () => { if (scrollContainer.scrollHeight - scrollContainer.scrollTop === scrollContainer.clientHeight) { console.log('滚动条到达底部!'); // 在这里执行到达底部时的操作 } if (scrollContainer.scrollTop === 0) { console.log('滚动条到达顶部!'); //获取聊天历史消息 } })