<style type="text/css">

.pad_right {
padding-right: 2em;
}

#scroll_div {
z-index: 999;
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;
}

}
</style>

<body>
<div id="scroll_div" class="fl">
<div id="scroll_begin">
汝若安好 <span class="pad_right">便是明天</span>
晨钟暮鼓<span class="pad_right">安之若素 </span>
</div>
<div id="scroll_end"></div>
</div>
<script type="text/javascript">

//文字左右滚动提示
function ScrollImgLeft() {
var speed = 50;
var MyMar = null;
var scroll_begin = document.getElementById("scroll_begin");
var scroll_end = document.getElementById("scroll_end");
var scroll_div = document.getElementById("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);
scroll_div.onmouseover = function () {
clearInterval(MyMar);
}
scroll_div.onmouseout = function () {
MyMar = setInterval(Marquee, speed);
}
}
ScrollImgLeft();


</script>
</body>

内容来源于网络如有侵权请私信删除