您现在的位置是:首页 >

表格文字滚动 用JavaScript实现上下文字滚动特效

火烧 2022-10-05 21:22:06 1033
用JavaScri t实现上下文字滚动特效   文字左右滚动的走马灯效果是一种非常容易实现的特效 同样的 文字上下滚动循环显示也是一种非常常见而且非常容易实现的文字特效   具体实现方法如下   lt

用JavaScript实现上下文字滚动特效  

  文字左右滚动的走马灯效果是一种非常容易实现的特效 同样的 文字上下滚动循环显示也是一种非常常见而且非常容易实现的文字特效

  具体实现方法如下

  <script language=javascript>var messages=new Array()messages[ ]= <font color=# FF>欢迎光临赛迪网电脑应用频道!</font></a> messages[ ]= <font color=#FB >这里有织网梦工厂</font></a> messages[ ]= <font color=#FF F>是网页初学者的学习园地</font></a> messages[ ]= <font color=#FF >这里冲浪指南针</font></a> messages[ ]= <font color=# CC >是网络爱好者天天必来充电的地方</font></a> messages[ ]= <font color=# >这里有…………有精彩的内容等着你</font></a>

var scrollerwidth= var scrollerheight= var scrollerbgcolor= #FFFFFF //下面的代码不要改动if (messages length> )i= elsei= function move (whichlayer){tlayer=eval(whichlayer)if (tlayer top> &&tlayer top<= ){tlayer top= setTimeout( move (tlayer) )setTimeout( move (document main document second) )return}if (tlayer top>=tlayer document height* ){tlayer top = setTimeout( move (tlayer) )}else{tlayer top=scrollerheighttlayer document write(messages[i])tlayer document close()if (i==messages length )i= elsei++}}function move (whichlayer){tlayer =eval(whichlayer)if (tlayer top> &&tlayer top<= ){tlayer top= setTimeout( move (tlayer ) )setTimeout( move (document main document first) )return}if (tlayer top>=tlayer document height* ){tlayer top = setTimeout( move (tlayer ) )}else{tlayer top=scrollerheighttlayer document write(messages[i])tlayer document close()if (i==messages length )i= elsei++}}function move (whichdiv){tdiv=eval(whichdiv)if (tdiv style pixelTop> &&tdiv style pixelTop<= ){tdiv style pixelTop= setTimeout( move (tdiv) )setTimeout( move (second ) )return}if (tdiv style pixelTop>=tdiv offsetHeight* ){tdiv style pixelTop = setTimeout( move (tdiv) )}else{tdiv style pixelTop=scrollerheighttdiv innerHTML=messages[i]if (i==messages length )i= elsei++}}function move (whichdiv){tdiv =eval(whichdiv)if (tdiv style pixelTop> &&tdiv style pixelTop<= ){tdiv style pixelTop= setTimeout( move (tdiv ) )setTimeout( move (first ) )return}if (tdiv style pixelTop>=tdiv offsetHeight* ){tdiv style pixelTop = setTimeout( move (second ) )}else{tdiv style pixelTop=scrollerheighttdiv innerHTML=messages[i]if (i==messages length )i= elsei++}}function startscroll(){if (document all){move (first )second style top=scrollerheight}else if (document layers){move (document main document first)document main document second top=scrollerheight+ document main document second visibility= show }}window onload=startscroll</script><ilayer id= main width=&{scrollerwidth}; height=&{scrollerheight};bgcolor=&{scrollerbgcolor};><layer id= first left= top= width=&{scrollerwidth};><script language= javascript >if (document layers)document write(messages[ ])</script></layer><layer id= second left= top= width=&{scrollerwidth}; visibility=hide><script language= javascript >if (document layers)document write(messages[ ])</script></layer></ilayer><script language= javascript >if (document all){document writeln( <span id= main > )document writeln( <div > )document writeln( <div id= first > )document write(messages[ ])document writeln( </div> )document writeln( <div id= second > )document write(messages[ ])document writeln( </div> )document writeln( </div> )document writeln( </span> )}</script>

表格文字滚动 用JavaScript实现上下文字滚动特效

  (在需要添加该特效的网页具体位置中粘贴如下代码即可)

lishixinzhi/Article/program/Java/JSP/201311/19753  
永远跟党走
  • 如果你觉得本站很棒,可以通过扫码支付打赏哦!

    • 微信收款码
    • 支付宝收款码