【发布时间】:2013-09-04 17:49:30
【问题描述】:
如何让网页在每次用户点击网页末尾时重复内容(一段文本)——就像无限滚动,但内容相同?
【问题讨论】:
-
选框?和 jQuery 用于检测从顶部滚动?
标签: html infinite-loop infinite-scroll infinite
如何让网页在每次用户点击网页末尾时重复内容(一段文本)——就像无限滚动,但内容相同?
【问题讨论】:
标签: html infinite-loop infinite-scroll infinite
已经回答了您的问题的线程:
Javascript how to detect if browser window is scrolled to the bottom
为了使其无限,您只需在每次达到“窗口底部”状态时附加一个带有其内容的标签。
这可以这样表达:
window.onscroll = function(ev) {
if ((window.innerHeight + window.scrollY) >= document.body.offsetHeight) {
// you're at the bottom of the page
var div = document.createElement('div')
div.innerHTML = "your content"
document.body.appendChild(div)
}
}
【讨论】:
div class="repeat_content",但这不起作用?
div.className="repeat_content"
<marquee>Scrolling text</marquee>
【讨论】:
<marquee> 标签已弃用,可能不适用于所有浏览器。