资料
表格
制度
合同
管理
职场
经营
创业
范文
总结
计划
作文
文章
美文
词句
教程
模板
图片
字体
图标
办公
人事
财务
生产
管理资源吧首页
>>>
教程
>>>
编程
>>>
JavaScript教程
>>>
javascript 单行文字向上跑马灯滚动显示
代码如下:
<html> <head> <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%3C!--%20%0D%0Afunction%20startmarquee(lh%2Cspeed%2Cdelay)%20%7B%20%0D%0A%20%20%20%20var%20p%3Dfalse%3B%20%0D%0A%20%20%20%20var%20t%3B%20%0D%0A%20%20%20%20var%20sh%3B%20%0D%0A%20%20%20%20var%20o%3Ddocument.getElementById(%22marqueebox%22)%3B%20%0D%0A%20%20%20%20o.innerHTML%2B%3Do.innerHTML%3B%20%0D%0A%20%20%20%20o.style.marginTop%3D0%3B%20%0D%0A%20%20%20%20o.onmouseover%3Dfunction()%7Bp%3Dtrue%3B%7D%20%0D%0A%20%20%20%20o.onmouseout%3Dfunction()%7Bp%3Dfalse%3B%7D%20%0D%0A%20%20%20%20function%20start()%7B%20%0D%0A%20%20%20%20%20%20%20%20sh%20%3D%20o.offsetHeight%3B%20%0D%0A%20%20%20%20%20%20%20%20o.style.height%20%3D%20sh%3B%20%0D%0A%20%20%20%20%20%20%20%20t%3DsetInterval(scrolling%2Cspeed)%3B%20%0D%0A%20%20%20%20%20%20%20%20if(!p)%20o.style.marginTop%3DparseInt(o.style.marginTop)-1%2B%22px%22%3B%20%0D%0A%20%20%20%20%7D%20%0D%0A%20%20%20%20function%20scrolling()%7B%20%0D%0A%20%20%20%20%20%20%20%20if(parseInt(o.style.marginTop)%25lh!%3D0)%7B%20%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20o.style.marginTop%3DparseInt(o.style.marginTop)-1%2B%22px%22%3B%20%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if(Math.abs(parseInt(o.style.marginTop))%3E%3Dsh%2F2)%20o.style.marginTop%3D0%3B%20%0D%0A%20%20%20%20%20%20%20%20%7Delse%7B%20%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20clearInterval(t)%3B%20%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20setTimeout(start%2Cdelay)%3B%20%0D%0A%20%20%20%20%20%20%20%20%7D%20%0D%0A%20%20%20%20%7D%20%0D%0A%20%20%20%20setTimeout(start%2Cdelay)%3B%20%0D%0A%7D%20%0D%0A%2F%2F%20--%3E%3C%2Fscript%3E"> </head> <body> <div style="overflow: hidden; height: 18px; margin-left: 5px;"> <div id="marqueebox" style="margin-top: -48px; height: 252px;"> <div class="tp"><a target="_blank" href="http://www.glzy8.com" _ewebeditor_ta_href="http%3A%2F%2Fwww.glzy8.com" >管理资源吧</a></div> <div class="tp"><a target="_blank" href="http://s.glzy8.com" _ewebeditor_ta_href="http%3A%2F%2Fs.glzy8.com" >服务器常用软件</a></div> <div class="tp"><a target="_blank" href="http://www.baidu.com" _ewebeditor_ta_href="http%3A%2F%2Fwww.baidu.com" >百度</a></div> <div class="tp"><a target="_blank" href="http://liulanqi.glzy8.com" _ewebeditor_ta_href="http%3A%2F%2Fliulanqi.glzy8.com">浏览器</a></div> </div> </div> </body> <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%3C!--%20%0D%0Astartmarquee(18%2C20%2C3000)%3B%20%0D%0A%2F%2F%20--%3E%3C%2Fscript%3E"> </html>
[Ctrl+A 全选 注:
如需引入外部Js需刷新才能执行
]
教程首页
更多教程