<
script
type
=
"text/javascript"
>
function startmarquee(lh, speed, delay) {
var t;
var oHeight = 300; /** p的高度 **/
var p = false;
var o = document.getElementById("show");
var preTop = 0;
o.scrollTop = 0;
function start() {
t = setInterval(scrolling, speed);
o.scrollTop += 1;
}
function scrolling() {
if (o.scrollTop % lh != 0
&& o.scrollTop % (o.scrollHeight - oHeight - 1) != 0) {
preTop = o.scrollTop;
o.scrollTop += 1;
if (preTop >= o.scrollHeight || preTop == o.scrollTop) {
o.scrollTop = 0;
}
} else {
clearInterval(t);
setTimeout(start, delay);
}
}
setTimeout(start, delay);
}
window.onload = function () {
/**startmarquee(一次滚动高度,速度,停留时间);**/
startmarquee(20, 40, 50);
}
</
script
>
<
p
id
=
"show"
style
=
"height: 600px; width: 100%; overflow-y: scroll;scrollbar-base-color:#ffffff;SCROLLBAR-HIGHLIGHT-COLOR:#ffffff;SCROLLBAR-ARROW-COLOR:#ffffff; overflow-x: none;"
></
p
>