向左滚动文字 js代码效果
2013-08-17 00:00
561 查看
<html> <head> <title>滚动文字效果</title> <style type="text/css"> #infozone{font-size:12px;color:#aa6;overflow:hidden;width:100px;height:20px;} #infozone div{height:20px;line-height:20px;white-space:nowrap;overflow:hidden;} </style> <script type="text/javascript"> var tc; window.onload=function(){ var o=document.getElementById('infozone');hscroll(o); window.setInterval(function(){window.clearTimeout(tc);o.firstChild.style.marginLeft='0px';scrollup(o,20,0);},10000); } function scrollup(o,d,c){ if(d==c){ var t=o.firstChild.cloneNode(true); o.removeChild(o.firstChild);o.appendChild(t); t.style.marginTop=o.firstChild.style.marginTop='0px'; hscroll(o); } else{ ch=false;var s=3,c=c+s,l=(c>=d?c-d:0); o.firstChild.style.marginTop=-c+l+'px'; window.setTimeout(function(){scrollup(o,d,c-l)},50); } } function hscroll(o){ var w1=o.firstChild.offsetWidth,w2=o.offsetWidth; if(w1<=w2)return; tc=window.setTimeout(function(){hs(o,w1-w2,0,w1-w2)},3500); } function hs(o,d,c,p){ c++;var t=(c>0?-c:c);o.firstChild.style.marginLeft=t+'px'; if(c==d){if(d==0){tc=window.setTimeout(function(){hs(o,p,0,p)},2500);}else tc=window.setTimeout(function(){hs(o,0,-p,p)},3500);} else tc=window.setTimeout(function(){hs(o,d,c,p)},5); } </script> </head> <body> <div id="infozone"><div>C# 鼠标属性动态操作相关源码示例,比如、隐藏与显示鼠标指针、将鼠标左右键功能互换、更换鼠标指针形状、调用Windows鼠标设置面板等,小技巧,多多益善。</div></div> </body> </html></td> </tr> </table>
相关文章推荐
- 向左滚动文字 js代码效果
- jQuery不间断滚动效果(模拟百度新闻支持文字/图片/垂直滚动)
- jquery单行文字向上滚动效果的实现代码
- jquery 单行滚动、批量多行滚动、文字图片翻屏滚动效果代码
- jquery插件之文字间歇自动向上滚动效果代码
- 代替marquee的滚动字幕效果js代码
- 文字自动自左向右滚动的js代码
- js 文字滚动效果。
- js实现文字滚动效果
- android 用textview实现文字滚动效果
- JQuery实现文字无缝滚动效果示例代码(Marquee插件)
- 仿猫扑网页下方状态栏效果代码 网页状态栏显示滚动文字
- js实现文字定时向上滚动效果_文字特效_js网页特效代码
- Static控件和状态栏文字滚动效果实现
- 新浪微博首页文字淡入淡出滚动效果
- Android 文字自动滚动(跑马灯)效果的两种实现方法
- 使用JS写一个文字滚动效果
- 跑马灯效果(文字滚动)
- JS实现的新浪微博大厅文字内容滚动效果代码
- TextView实现跑马灯效果(文字滚动)