昨日代码,记录代码片断
Tech
Css
DHTML
ASP
PHP
MSSQL
MYSQL
VC++
VB
小常识
程序源码
常用工具
网络安全
英语知识
英语学习资料
您的位置:
Home
>>
DHTML
控制iframe页滚动的js
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>It365cn.com</title> <link href="http://www.it365cn.com/preview/style.css" rel="stylesheet" type="text/css"> <script> function movstar(a,time) { movx=setInterval("mov("+a+")",time); } function movover() { clearInterval(movx); } function mov(a) { scrollx=new_date.document.body.scrollLeft; scrolly=new_date.document.body.scrollTop; scrolly=scrolly+a; new_date.window.scroll(scrollx,scrolly); } </script> </head> <body leftmargin="0" topmargin="0" style="text-align: center;"> <iframe border="1" frameborder="0" framespacing="0" width="600" height="200" marginheight="0" marginwidth="0" name="new_date" noResize scrolling="no" src="World Wide Web Consortium.htm" vspale="0"></iframe><br /><br /> <img src="http://www.it365cn.com/preview/images/arrowup.gif" class="opacity" width="13" height="13" align="absmiddle" alt="点住不放可以快速向上滚动" onmousedown="movover();movstar(-3,2)" onmouseout="movover();" onmouseover="movstar(-1,20);" onmouseup="movover();movstar(-1,20)" style="cursor:hand"> <img src="http://www.it365cn.com/preview/images/arrowdown.gif" class="opacity" onmousedown="movover();movstar(3,2)" onmouseout="movover();" onmouseover="movstar(1,20);" onmouseup="movover();movstar(1,20)" alt="点住不放可以快速向下滚动" width="13" height="13" border="0" align="absmiddle" style="cursor:hand"> </body> </html>
[提示:你可先修改部分代码,再按运行]
代码CODE 备案编号:
吉ICP备2022000970号-1