<div id="mq" οnclick="return false;" value ="" > 轻轻的我走了, 正如我轻轻的来; 我轻轻的招手, 作别西天的云彩。 那河;
</div>
<div id="sh" style="width:500px;height:14px;overflow:hidden;color:red;" >
</div>
<script>
document.getElementById("mq").style.display="none";
var oMarquee = document.getElementById("mq"); //滚动对象
var sh = document.getElementById("sh"); //滚动对象
var c = '<<' + oMarquee.innerHTML;
var strLen = c.length;
var begin = 0;
function run() {
//oMarquee.innerHTML = c.substring(begin) + c.substring(0,begin);
sh.innerHTML = c.substring(begin) + c.substring(0,begin);
//alert(begin+" " +c.substring(begin)+" "+c.substring(0,begin))
begin++;
if(begin == strLen){
begin = 0;
}
window.setTimeout( "run()", 150 );
}
run();
</script>
js-左右滚动
最新推荐文章于 2024-08-09 14:40:54 发布