文字向上间歇滚动
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=GBK"> <title>文字间歇向上滚动</title> <meta name="author" content="zolra"> <style type="text/css"> #ScrollBox { width:400px;height:24px;overflow:hidden;line-height:24px;font-size:12px;border:1px solid #ccc;padding-left:10px; } #ScrollBox a { display:block; } </style> </head> <body> <div id="ScrollBox"> <a href="#">关于推出“联合在线”客户专属转账优惠套餐的通告</a> <a href="#">满金宝点差优惠活动通知</a> <a href="#">关于下调个人网银转账(汇款)业务收费标准的通告</a> <a href="#">《新金融》期刊征订启事</a> </div> </body> </html>
<script type="text/javascript"> with(scrollBox = document.getElementById("ScrollBox")){ var height = 24; //滚动高度,与line-height一致 var speed = 20; //滚动速度(ms) var delay = 2000; //停留间隔(ms) var pause = 0; //是否暂停 scrollBox.innerHTML += scrollBox.innerHTML; scrollBox.scrollTop = 0; onmouseover = Function("pause=1"); onmouseout = Function("pause=0"); (scroll=Function("if(scrollBox.scrollTop%height||!pause)scrollBox.scrollTop++,scrollBox.scrollTop%=scrollBox.scrollHeight>>1; setTimeout(scroll,scrollBox.scrollTop%height?speed:delay)"))(); } </script>