大屏某区域滚动效果循环
// 數(shù)據(jù)自動(dòng)滾動(dòng)事件BEGIN
var botTimer = null;? // 定時(shí)器對(duì)象
$('.tbody').hover(function () {
clearInterval(botTimer); // hover
}, function () {
scrollCore('tbodyScroll', 'tbody'); //out
}); //
function scrollCore(outerId, innerId) {
var winHei = $("#" + outerId).height();
var listHei = $("#" + innerId).height();
var top = document.getElementById(innerId).style.marginTop.replace('px', '') ? document.getElementById(innerId).style.marginTop.replace('px', '') : 0;
botTimer = setInterval(function () {
if (Math.abs(top) >= (listHei - winHei)) {
//請(qǐng)求最新數(shù)據(jù)
//listHei = loadNewData(innerId);
if (Math.abs(top) >= (listHei - winHei)) {
// 如果沒(méi)有再多數(shù)據(jù),就清空定時(shí)器
clearInterval(botTimer);
document.getElementById(innerId).style.marginTop = 0;
// 再次調(diào)函數(shù)
scrollCore(outerId, innerId);
} else {
top -= 1;?
document.getElementById(innerId).style.marginTop = top + 'px';//px
}
} else {
top -= 1;
document.getElementById(innerId).style.marginTop = top + 'px';//px
}
}, 200);
}
// END
轉(zhuǎn)載于:https://www.cnblogs.com/auto123-num/p/11446939.html
總結(jié)
以上是生活随笔為你收集整理的大屏某区域滚动效果循环的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 操作系统:体验Windows 11,不到
- 下一篇: 强大的离线字典《Colordict》+多