资料
表格
制度
合同
管理
职场
经营
创业
范文
总结
计划
作文
文章
美文
词句
教程
模板
图片
字体
图标
办公
人事
财务
生产
管理资源吧首页
>>>
教程
>>>
编程
>>>
JavaScript教程
>>>
经典的间隔时间滚动新闻(图片),可控制滚动
<!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> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>经典的间隔时间滚动新闻(图片),可控制滚动</title> <base target="_blank"> <style> *{margin:0;padding:0;border:0;list-style:none;} body{font:12px Verdana, Geneva, sans-serif;line-height:18px;color:#333;} a{text-decoration:none;color:#004285;font-size:14px;font-weight:bold;} a:hover{text-decoration:underline;color:#C33;} .rig{border:1px solid #dedede;width:282px;margin-bottom:5px;position:relative;background:#fff;} #qy a{font-size:12px;} h5 span a{font-size:12px;font-weight:normal;color:#333;} h5{padding:0 10px;font-size:14px;height:30px;line-height:30px;background:url(/upload/201005/20100530223157155.jpg?1259835263) left center repeat-x;border-bottom:1px solid #dedede;} span{float:right;} </style> </head> <body> <div class="rig"> <h5><span><a href="http://www.baidu.com" _ewebeditor_ta_href="http%3A%2F%2Fwww.baidu.com">更多>></a></span>精彩企业专题</h5> <div id="qy" style="width:256px;margin:7px 10px 5px;height:94px;overflow:hidden" onMouseOver="qiScrollAmount=0" onmouseout="qiScrollAmount=2"> <ul> <li id="tab1"> <table border='0' cellspacing='0' cellpadding='0' width='256px'> <tr> <td height='70'><a href="http://www.glzy8.com" _ewebeditor_ta_href="http%3A%2F%2Fwww.glzy8.com"><img src="http://files.glzy8.com/upload/201005/20100530223157697.gif" _ewebeditor_ta_src="http%3A%2F%2Ffiles.glzy8.com%2Fupload%2F201005%2F20100530223157697.gif" width="256" height="70" /></a></td> </tr> <tr> <td height='24'><span><a href="http://www.glzy8.com" _ewebeditor_ta_href="http%3A%2F%2Fwww.glzy8.com">进入专题</a></span> <p><a href="http://www.glzy8.com" _ewebeditor_ta_href="http%3A%2F%2Fwww.glzy8.com">管理资源吧</a></p></td> </tr> <!--一行--> <tr> <td height='70'><a href="http://s.glzy8.com" _ewebeditor_ta_href="http%3A%2F%2Fs.glzy8.com"><img src="http://files.glzy8.com/upload/201005/20100530223157387.gif" _ewebeditor_ta_src="http%3A%2F%2Ffiles.glzy8.com%2Fupload%2F201005%2F20100530223157387.gif" width="256" height="70"/></a></td> </tr> <tr> <td height='24'><span><a href="http://tools.glzy8.com" _ewebeditor_ta_href="http%3A%2F%2Ftools.glzy8.com">站长查询2</a></span> <p><a href="http://www.baidu.com" _ewebeditor_ta_href="http%3A%2F%2Fwww.baidu.com">百度2</a></p></td> </tr> <!--一行--> <tr> <td height='70'><a href="http://s.glzy8.com" _ewebeditor_ta_href="http%3A%2F%2Fs.glzy8.com"><img src="http://files.glzy8.com/upload/201005/20100530223157387.gif" _ewebeditor_ta_src="http%3A%2F%2Ffiles.glzy8.com%2Fupload%2F201005%2F20100530223157387.gif" width="256" height="70"/></a></td> </tr> <tr> <td height='24'><span><a href="http://tools.glzy8.com" _ewebeditor_ta_href="http%3A%2F%2Ftools.glzy8.com">站长查询</a></span> <p><a href="http://www.baidu.com" _ewebeditor_ta_href="http%3A%2F%2Fwww.baidu.com">百度</a></p></td> </tr> </table> </li> <li id="tab2"></li> </ul> </div> <style> #btm{position:absolute;right:0;top:60px;width:12px;height:43px;background:url(/upload/201005/20100530223157574.gif) no-repeat;overflow:hidden;} #btm a{display:block;height:22px;} #btm a#up:hover{background:url(/upload/201005/20100530223157574.gif) -13px top no-repeat;} #btm a#dw:hover{background:url(/upload/201005/20100530223157574.gif) -26px -22px no-repeat;} </style> <div id="btm"><a id="up" onclick="up()" href="javascript:;" _ewebeditor_ta_href="javascript%3A%3B" target="_self"></a><a id="dw" onclick="dw()" href="javascript:;" _ewebeditor_ta_href="javascript%3A%3B" target="_self"></a></div> <img src="/_New/_cj/myeditor/sysimage/space.gif" class="ewebeditor__script" _ewebeditor_fake_tag="script" _ewebeditor_fake_value="%3Cscript%3E%20%0D%0Avar%20qoMarquee%20%3D%20document.getElementById(%22qy%22)%3B%20%2F%2F%E6%BB%9A%E5%8A%A8%E5%AF%B9%E8%B1%A1%20%0D%0Avar%20tab1%20%3D%20document.getElementById(%22tab1%22)%3B%20%0D%0Avar%20tab2%20%3D%20document.getElementById(%22tab2%22)%3B%20%0D%0Avar%20qiLineHeight%20%3D%2094%3B%2F%2F%E5%8D%95%E8%A1%8C%E9%AB%98%E5%BA%A6%EF%BC%8C%E5%83%8F%E7%B4%A0IE%20%0D%0Avar%20qiLineCount%20%3D%200%3B%20%2F%2F%E5%AE%9E%E9%99%85%E8%A1%8C%E6%95%B0%20%0D%0Avar%20qiScrollAmount%20%3D%202%3B%20%2F%2F%E6%AF%8F%E6%AC%A1%E6%BB%9A%E5%8A%A8%E9%AB%98%E5%BA%A6%EF%BC%8C%E5%83%8F%E7%B4%A0%EF%BC%88%E9%80%9F%E5%BA%A6%EF%BC%89%20%0D%0Avar%20speed1%3D3000%3B%2F%2F%E6%AF%8F%E6%AC%A1%E5%81%9C%E7%95%99%E6%97%B6%E9%97%B4%20%0D%0Avar%20speed2%3D1%3B%2F%2F%E6%BB%9A%E5%8A%A8%E9%80%9F%E5%BA%A6%20%0D%0Avar%20num%3DqoMarquee.getElementsByTagName('img').length%3B%2F%2F%E6%80%BB%E6%95%B0%20%0D%0Atab2.innerHTML%3Dtab1.innerHTML%3B%20%0D%0Avar%20alink%3Ddocument.getElementById('btm').getElementsByTagName('a')%3B%20%0D%0Afor(var%20i%3D0%3Bi%3Calink.length%3Bi%2B%2B)%7B%20%0D%0Aalink%5Bi%5D.onfocus%3Dfunction()%7Bthis.blur()%3B%7D%20%0D%0A%7D%20%0D%0Afunction%20run()%20%7B%20%0D%0Aif(qoMarquee.scrollTop%3D%3Dnum*qiLineHeight)%7BqoMarquee.scrollTop%3D0%3Bwindow.setTimeout(%20%22run()%22%2C%20speed2%20)%3B%7D%2F%2F%E9%87%8D%E7%BD%AE%E5%B9%B6%E6%8E%A5%E7%9D%80%E6%BB%9A%E5%8A%A8%20%0D%0Aelse%7B%20%0D%0AqoMarquee.scrollTop%20%2B%3DqiScrollAmount%3B%20%0D%0Aif%20(%20qoMarquee.scrollTop%20%25%20qiLineHeight%20%3D%3D%200%20)%20%7Bwindow.setTimeout(%20%22run()%22%2C%20speed1%20)%3B%7D%2F%2F%E5%A6%82%E6%9E%9C%E6%BB%A1%E6%A0%BC%E7%AD%89%E5%BE%85N%E7%A7%92%20%0D%0Aelse%20%7Bwindow.setTimeout(%20%22run()%22%2C%20speed2%20)%3B%7D%2F%2F%E6%AD%A3%E5%B8%B8%E6%BB%9A%E5%8A%A8%20%0D%0A%7D%20%0D%0A%7D%20%0D%0Afunction%20up()%7B%20%0D%0AqiScrollAmount%20%3D%200%3B%20%0D%0Avar%20amount%3D1%3B%20%0D%0Aif(qoMarquee.scrollTop%3D%3Dnum*qiLineHeight)%20qoMarquee.scrollTop%3D0%3B%20%0D%0AqoMarquee.scrollTop%20%2B%3Damount%3B%20%0D%0Aif%20(%20qoMarquee.scrollTop%20%25%20qiLineHeight%20%3D%3D%200%20)%20%7Bamount%3D0%3Bwindow.setTimeout(%20%22qiScrollAmount%20%3D%202%22%2C%20speed1%20)%3B%7D%20%0D%0Aelse%20window.setTimeout(%20up()%2C%201%20)%3B%20%0D%0A%7D%20%0D%0Afunction%20dw()%7B%20%0D%0AqiScrollAmount%20%3D%200%3B%20%0D%0Avar%20amount%3D1%3B%20%0D%0Aif(qoMarquee.scrollTop%3D%3D0)%20qoMarquee.scrollTop%3Dnum*qiLineHeight%3B%20%0D%0AqoMarquee.scrollTop%20-%3Damount%3B%20%0D%0Aif%20(%20qoMarquee.scrollTop%20%25%20qiLineHeight%20%3D%3D%200%20)%20%7Bamount%3D0%3Bwindow.setTimeout(%20%22qiScrollAmount%20%3D%202%22%2C%20speed1%20)%3B%7D%20%0D%0Aelse%20window.setTimeout(%20dw()%2C%201%20)%3B%20%0D%0A%7D%20%0D%0Awindow.setTimeout(%20%22run()%22%2C%20speed1%20)%3B%20%0D%0A%3C%2Fscript%3E"> </div> </body> </html>
[Ctrl+A 全选 注:
如需引入外部Js需刷新才能执行
]
教程首页
更多教程