资料
表格
制度
合同
管理
职场
经营
创业
范文
总结
计划
作文
文章
美文
词句
教程
模板
图片
字体
图标
办公
人事
财务
生产
管理资源吧首页
>>>
教程
>>>
编程
>>>
JavaScript教程
>>>
一定时间滚动的链接菜单效果
<html> <head> <meta http-equiv="Content-Language" content="zh-cn"> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>定时滚动链接的菜单</title> <body> <img src="/_New/_cj/myeditor/sysimage/space.gif" class="ewebeditor__script" _ewebeditor_fake_tag="script" _ewebeditor_fake_value="%3Cscript%3E%20%0D%0Avar%20scrollerwidth%3D115%20%0D%0Avar%20scrollerheight%3D131%20%0D%0Avar%20scrollerbgcolor%3D'%23FFFFFF'%20%0D%0A%2F%2F3000%20miliseconds%3D9%20seconds%20%0D%0Avar%20pausebetweenimages%3D4000%20%0D%0A%0D%0Avar%20slideimages%3Dnew%20Array()%20%0D%0Aslideimages%5B0%5D%3D'%3Ca%20href%3D%22%23%22%20target%3D%22_blank%22%3E%E4%BD%A0%E7%9A%84%E9%93%BE%E6%8E%A5%3C%2Fa%3E%0D%0A%0D%0A%3Ca%20href%3D%22%23%22%20target%3D%22_blank%22%3E%E4%BD%A0%E7%9A%84%E9%93%BE%E6%8E%A5%3C%2Fa%3E%0D%0A%0D%0A%3Ca%20href%3D%22%23%22%20target%3D%22_blank%22%3E%E4%BD%A0%E7%9A%84%E9%93%BE%E6%8E%A5%3C%2Fa%3E%0D%0A%0D%0A%3Ca%20href%3D%22%23%22%20target%3D%22_blank%22%3E%E4%BD%A0%E7%9A%84%E9%93%BE%E6%8E%A5%3C%2Fa%3E'%20%0D%0Aslideimages%5B1%5D%3D'%3Ca%20href%3D%22%23%22%20target%3D%22_blank%22%3E%E4%BD%A0%E7%9A%84%E9%93%BE%E6%8E%A5%3C%2Fa%3E%0D%0A%0D%0A%3Ca%20href%3D%22%23%22%20target%3D%22_blank%22%3E%E4%BD%A0%E7%9A%84%E9%93%BE%E6%8E%A5%3C%2Fa%3E%0D%0A%0D%0A%3Ca%20href%3D%22%23%22%20target%3D%22_blank%22%3E%E4%BD%A0%E7%9A%84%E9%93%BE%E6%8E%A5%3C%2Fa%3E%0D%0A%0D%0A%3Ca%20href%3D%22%23%22%20target%3D%22_blank%22%3E%E4%BD%A0%E7%9A%84%E9%93%BE%E6%8E%A5%3C%2Fa%3E'%20%0D%0Aslideimages%5B2%5D%3D'%3Ca%20href%3D%22%23%22%20target%3D%22_blank%22%3E%E4%BD%A0%E7%9A%84%E9%93%BE%E6%8E%A5%3C%2Fa%3E%0D%0A%0D%0A%3Ca%20href%3D%22%23%22%20target%3D%22_blank%22%3E%E4%BD%A0%E7%9A%84%E9%93%BE%E6%8E%A5%3C%2Fa%3E%0D%0A%0D%0A%3Ca%20href%3D%22%23%22%20target%3D%22_blank%22%3E%E4%BD%A0%E7%9A%84%E9%93%BE%E6%8E%A5%3C%2Fa%3E%0D%0A%0D%0A%3Ca%20href%3D%22%23%22%20target%3D%22_blank%22%3E%E4%BD%A0%E7%9A%84%E9%93%BE%E6%8E%A5%3C%2Fa%3E'%20%0D%0Aslideimages%5B3%5D%3D'%3Ca%20href%3D%22%23%22%20target%3D%22_blank%22%3E%E4%BD%A0%E7%9A%84%E9%93%BE%E6%8E%A5%3C%2Fa%3E%0D%0A%0D%0A%3Ca%20href%3D%22%23%22%20target%3D%22_blank%22%3E%E4%BD%A0%E7%9A%84%E9%93%BE%E6%8E%A5%3C%2Fa%3E%0D%0A%0D%0A%3Ca%20href%3D%22%23%22%20target%3D%22_blank%22%3E%E4%BD%A0%E7%9A%84%E9%93%BE%E6%8E%A5%3C%2Fa%3E%0D%0A%0D%0A%3Ca%20href%3D%22%23%22%20target%3D%22_blank%22%3E%E4%BD%A0%E7%9A%84%E9%93%BE%E6%8E%A5%3C%2Fa%3E'%20%0D%0A%20%20%20%0D%0A%0D%0Aif%20(slideimages.length%3E1)%20%0D%0Ai%3D2%20%0D%0Aelse%20%0D%0Ai%3D0%20%0D%0A%0D%0Afunction%20move1(whichlayer)%7B%20%0D%0Atlayer%3Deval(whichlayer)%20%0D%0Aif%20(tlayer.top%3E0%26%26tlayer.top%3C%3D4)%7B%20%0D%0Atlayer.top%3D0%20%0D%0AsetTimeout(%22move1(tlayer)%22%2Cpausebetweenimages)%20%0D%0AsetTimeout(%22move2(document.main.document.second)%22%2Cpausebetweenimages)%20%0D%0Areturn%20%0D%0A%7D%20%0D%0Aif%20(tlayer.top%3E%3Dtlayer.document.height*-1)%7B%20%0D%0Atlayer.top-%3D4%20%0D%0AsetTimeout(%22move1(tlayer)%22%2C100)%20%0D%0A%7D%20%0D%0Aelse%7B%20%0D%0Atlayer.top%3Dscrollerheight%20%0D%0Atlayer.document.write(slideimages%5Bi%5D)%20%0D%0Atlayer.document.close()%20%0D%0Aif%20(i%3D%3Dslideimages.length-1)%20%0D%0Ai%3D0%20%0D%0Aelse%20%0D%0Ai%2B%2B%20%0D%0A%7D%20%0D%0A%7D%20%0D%0A%0D%0Afunction%20move2(whichlayer)%7B%20%0D%0Atlayer2%3Deval(whichlayer)%20%0D%0Aif%20(tlayer2.top%3E0%26%26tlayer2.top%3C%3D4)%7B%20%0D%0Atlayer2.top%3D0%20%0D%0AsetTimeout(%22move2(tlayer2)%22%2Cpausebetweenimages)%20%0D%0AsetTimeout(%22move1(document.main.document.first)%22%2Cpausebetweenimages)%20%0D%0Areturn%20%0D%0A%7D%20%0D%0Aif%20(tlayer2.top%3E%3Dtlayer2.document.height*-1)%7B%20%0D%0Atlayer2.top-%3D4%20%0D%0AsetTimeout(%22move2(tlayer2)%22%2C100)%20%0D%0A%7D%20%0D%0Aelse%7B%20%0D%0Atlayer2.top%3Dscrollerheight%20%0D%0Atlayer2.document.write(slideimages%5Bi%5D)%20%0D%0Atlayer2.document.close()%20%0D%0Aif%20(i%3D%3Dslideimages.length-1)%20%0D%0Ai%3D0%20%0D%0Aelse%20%0D%0Ai%2B%2B%20%0D%0A%7D%20%0D%0A%7D%20%0D%0A%0D%0Afunction%20move3(whichdiv)%7B%20%0D%0Atdiv%3Deval(whichdiv)%20%0D%0Aif%20(tdiv.style.pixelTop%3E0%26%26tdiv.style.pixelTop%3C%3D4)%7B%20%0D%0Atdiv.style.pixelTop%3D0%20%0D%0AsetTimeout(%22move3(tdiv)%22%2Cpausebetweenimages)%20%0D%0AsetTimeout(%22move4(second2)%22%2Cpausebetweenimages)%20%0D%0Areturn%20%0D%0A%7D%20%0D%0Aif%20(tdiv.style.pixelTop%3E%3Dtdiv.offsetHeight*-1)%7B%20%0D%0Atdiv.style.pixelTop-%3D4%20%0D%0AsetTimeout(%22move3(tdiv)%22%2C100)%20%0D%0A%7D%20%0D%0Aelse%7B%20%0D%0Atdiv.style.pixelTop%3Dscrollerheight%20%0D%0Atdiv.innerHTML%3Dslideimages%5Bi%5D%20%0D%0Aif%20(i%3D%3Dslideimages.length-1)%20%0D%0Ai%3D0%20%0D%0Aelse%20%0D%0Ai%2B%2B%20%0D%0A%7D%20%0D%0A%7D%20%0D%0A%0D%0Afunction%20move4(whichdiv)%7B%20%0D%0Atdiv2%3Deval(whichdiv)%20%0D%0Aif%20(tdiv2.style.pixelTop%3E0%26%26tdiv2.style.pixelTop%3C%3D4)%7B%20%0D%0Atdiv2.style.pixelTop%3D0%20%0D%0AsetTimeout(%22move4(tdiv2)%22%2Cpausebetweenimages)%20%0D%0AsetTimeout(%22move3(first2)%22%2Cpausebetweenimages)%20%0D%0Areturn%20%0D%0A%7D%20%0D%0Aif%20(tdiv2.style.pixelTop%3E%3Dtdiv2.offsetHeight*-1)%7B%20%0D%0Atdiv2.style.pixelTop-%3D4%20%0D%0AsetTimeout(%22move4(second2)%22%2C100)%20%0D%0A%7D%20%0D%0Aelse%7B%20%0D%0Atdiv2.style.pixelTop%3Dscrollerheight%20%0D%0Atdiv2.innerHTML%3Dslideimages%5Bi%5D%20%0D%0Aif%20(i%3D%3Dslideimages.length-1)%20%0D%0Ai%3D0%20%0D%0Aelse%20%0D%0Ai%2B%2B%20%0D%0A%7D%20%0D%0A%7D%20%0D%0A%0D%0Afunction%20startscroll()%7B%20%0D%0Aif%20(document.all)%7B%20%0D%0Amove3(first2)%20%0D%0Asecond2.style.top%3Dscrollerheight%20%0D%0A%7D%20%0D%0Aelse%20if%20(document.layers)%7B%20%0D%0Amove1(document.main.document.first)%20%0D%0Adocument.main.document.second.top%3Dscrollerheight%2B5%20%0D%0Adocument.main.document.second.visibility%3D'show'%20%0D%0A%7D%20%0D%0A%7D%20%0D%0A%0D%0Awindow.onload%3Dstartscroll%20%0D%0A%0D%0Aif%20(document.layers)%20%0D%0Adocument.write(slideimages%5B0%5D)%20%0D%0A%0D%0Aif%20(document.layers)%20%0D%0Adocument.write(slideimages%5B1%5D)%20%0D%0A%0D%0Aif%20(document.layers)%20%0D%0Adocument.write(slideimages%5B0%5D)%20%0D%0A%0D%0Aif%20(document.all)%7B%20%0D%0Adocument.writeln('%3Cspan%20id%3D%22main2%22%20style%3D%22position%3Arelative%3Bwidth%3A'%2Bscrollerwidth%2B'%3Bheight%3A'%2Bscrollerheight%2B'%3Boverflow%3Ahiden%3Bbackground-color%3A'%2Bscrollerbgcolor%2B'%22%3E')%20%0D%0Adocument.writeln('%3Cdiv%20style%3D%22position%3Aabsolute%3Bwidth%3A'%2Bscrollerwidth%2B'%3Bheight%3A'%2Bscrollerheight%2B'%3Bclip%3Arect(0%20'%2Bscrollerwidth%2B'%20'%2Bscrollerheight%2B'%200)%3Bleft%3A0%3Btop%3A0%22%3E')%20%0D%0Adocument.writeln('%3Cdiv%20id%3D%22first2%22%20style%3D%22position%3Aabsolute%3Bwidth%3A'%2Bscrollerwidth%2B'%3Bleft%3A0%3Btop%3A1%3B%22%3E')%20%0D%0Adocument.write(slideimages%5B0%5D)%20%0D%0Adocument.writeln('%3C%2Fdiv%3E')%20%0D%0Adocument.writeln('%3Cdiv%20id%3D%22second2%22%20style%3D%22position%3Aabsolute%3Bwidth%3A'%2Bscrollerwidth%2B'%3Bleft%3A0%3Btop%3A0%22%3E')%20%0D%0Adocument.write(slideimages%5B1%5D)%20%0D%0Adocument.writeln('%3C%2Fdiv%3E')%20%0D%0Adocument.writeln('%3C%2Fdiv%3E')%20%0D%0Adocument.writeln('%3C%2Fspan%3E')%20%0D%0A%7D%20%0D%0A%3C%2Fscript%3E"> </body> </html>
[Ctrl+A 全选 注:
如需引入外部Js需刷新才能执行
]
教程首页
更多教程