日期:2014-05-17 浏览次数:20484 次
<div id="gundong1" style="overflow:hidden;height:86px;width:252px;">
<ul id="gundong2">
<li><a href="#">热烈庆祝我校网站正式开通运行</a></li>
<li><a>我校校长就当前就业形势发表讲话</a></li>
<li><a>热烈庆祝我校网站正式开通运行</a></li>
<li><a>热烈庆祝我校网站正式开通运行</a></li>
<li><a>热烈庆祝我校网站正式开通运行</a></li>
<li><a>热烈庆祝我校网站正式开通运行</a></li>
<li><a>热烈庆祝我校网站正式开通运行</a></li>
<li><a href="#">热烈庆祝我校网站正式开通运行</a></li>
</ul>
<div id="gundong3"></div>
</div>
#gundong2{
height:auto;
text-align:left;
}
#gundong3{
height:auto;
text-align:left;
}
#gundong2 li{
list-style-type:none;
height:22px;
background:url() no-repeat left center;
text-align:left;
text-indent:15px;
}
#gundong3 li{
list-style-type:none;
height:22px;
background:url() no-repeat left center;
text-align:left;
text-indent:15px;
}
speed = 60;
var gundong1 = document.getElementById("gundong1");
var gundong3 = document.getElementById("gundong3");
var gundong2 = document.getElementById("gundong2");
gundong3.innerHTML = gundong2.innerHTML;
function Marquee() {
if (gundong3.offsetTop - gundong1.scrollTop <= 0)
gundong1.scrollTop -= gundong2.offsetHeight;
else {
gundong1.scrollTop++;
}
}
var MyMar = setInterval(Marquee, speed);
gundong1.onmouseover = function () { clearInterval(MyMar) }
gundong1.onmouseout = function () { MyMar = setInterval(Marquee, speed) }