资料
表格
制度
合同
管理
职场
经营
创业
范文
总结
计划
作文
文章
美文
词句
教程
模板
图片
字体
图标
办公
人事
财务
生产
管理资源吧首页
>>>
教程
>>>
编程
>>>
JavaScript教程
>>>
Js+CSS实现的间断和不间断文本滚动代码
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Js+CSS间断和不间断文本滚动代码</title> <meta http-equiv="content-type" content="text/html;charset=gb2312"> <style type="text/css"> .box{width:150px;height:25px;line-height:25px;border:#bbb 1px solid;overflow:hidden;} .box ul{margin:0;padding:0} .box li{height:25px;line-height:25px;font-size:12px;text-align:center;list-style-type:none;} </style> </head> <body> <div class="box" id="marqueebox0"> <ul> <li style="background:#f8e2ac;">第一行</li> <li style="background:#f5f5f5;">第二行</li> <li style="background:#ffe6ec;">第三行</li> </ul> </div><br> <div class="box" id="marqueebox1"> <ul> <li style="background:#f8e2ac;">第一行</li> <li style="background:#f5f5f5;">第二行</li> <li style="background:#ffe6ec;">第三行</li> </ul> </div> <img src="/_New/_cj/myeditor/sysimage/space.gif" class="ewebeditor__script" _ewebeditor_fake_tag="script" _ewebeditor_fake_value="%3Cscript%20type%3D%22text%2Fjavascript%22%3E%20%0D%0Afunction%20startmarquee(lh%2Cspeed%2Cdelay%2Cindex)%7B%20%0D%0Avar%20t%3B%20%0D%0Avar%20p%3Dfalse%3B%20%0D%0Avar%20o%3Ddocument.getElementById(%22marqueebox%22%2Bindex)%3B%20%0D%0Ao.innerHTML%2B%3Do.innerHTML%3B%20%0D%0Ao.onmouseover%3Dfunction()%7Bp%3Dtrue%7D%20%0D%0Ao.onmouseout%3Dfunction()%7Bp%3Dfalse%7D%20%0D%0Ao.scrollTop%20%3D%200%3B%20%0D%0Afunction%20start()%7B%20%0D%0At%3DsetInterval(scrolling%2Cspeed)%3B%20%0D%0Aif(!p)%7B%20o.scrollTop%20%2B%3D%201%3B%7D%20%0D%0A%7D%20%0D%0Afunction%20scrolling()%7B%20%0D%0Aif(o.scrollTop%25lh!%3D0)%7B%20%0D%0Ao.scrollTop%20%2B%3D%201%3B%20%0D%0Aif(o.scrollTop%3E%3Do.scrollHeight%2F2)%20o.scrollTop%20%3D%200%3B%20%0D%0A%7Delse%7B%20%0D%0AclearInterval(t)%3B%20%0D%0AsetTimeout(start%2Cdelay)%3B%20%0D%0A%7D%20%0D%0A%7D%20%0D%0AsetTimeout(start%2Cdelay)%3B%20%0D%0A%7D%20%0D%0Astartmarquee(25%2C30%2C3000%2C0)%3B%20%0D%0Astartmarquee(25%2C40%2C0%2C1)%3B%20%0D%0A%3C%2Fscript%3E"> </body> </html>
[Ctrl+A 全选 注:
如需引入外部Js需刷新才能执行
]
教程首页
更多教程