让⽂字左右滚动的html,JS实现⽂字左右滚动.pad_right {
padding-right: 2em;
}
#scroll_div {
z-index: 999;
js文字动画特效position: fixed;
top: 0;
height: 36px;
overflow: hidden;
white-space: nowrap;
width: 88%;
margin-left: 22px;
margin-right: 57px;
margin-top: 0px;
padding-top: 10px;
background-color: #f4f4f4;
}
#scroll_begin, #scroll_end {
display: inline;
}
}
汝若安好 便是明天
晨钟暮⿎安之若素
//⽂字左右滚动提⽰
function ScrollImgLeft() {
var speed = 50;
var MyMar = null;
var scroll_begin = ElementById("scroll_begin");
var scroll_end = ElementById("scroll_end");
var scroll_div = ElementById("scroll_div");
scroll_end.innerHTML = scroll_begin.innerHTML;
function Marquee() {
if (scroll_end.offsetWidth - scroll_div.scrollLeft <= 0)
scroll_div.scrollLeft -= scroll_begin.offsetWidth; else
scroll_div.scrollLeft++;
}
MyMar = setInterval(Marquee, speed);
useover = function () { clearInterval(MyMar);
}
useout = function () {
MyMar = setInterval(Marquee, speed);
}
}
ScrollImgLeft();
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论