滚动条自动滚动
onMounted(() => {
let content = document.getElementById('content')
let clientheight = content.clientHeight
let offsetheight = content.scrollHeight
let h = offsetheight - clientheight
var position = 0
function startscroll() {
if (content.scrollTop < h) {
position++;
content.scrollTop = position
}
if (content.scrollTop >= h) {
content.scrollTop = 0;
position = 0
}
}
setInterval(startscroll, 100)
})
滚动条自动滚动
http://xuyuanhang.com//archives/gun-dong-tiao-zi-dong-gun-dong