发新话题
打印

iframe控制页面上下左右移动

iframe控制页面上下左右移动

<HTML>
<HEAD>
<TITLE>无标题文档</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<script>
function movstar(a,time){
movx=setInterval("mov("+a+")",time)
}
function movover(){
clearInterval(movx)
}
function movstar2(b,time){
movx2=setInterval("mov2("+b+")",time)
}
function movover2(){
clearInterval(movx2)
}
function mov(a){
scrollx=win1.document.body.scrollLeft
scrolly=win1.document.body.scrollTop
scrolly=scrolly+a
win1.window.scroll(scrollx,scrolly)
}
function mov2({
scrollx=win1.document.body.scrollLeft
scrolly=win1.document.body.scrollTop
scrollx=scrollx+b
win1.window.scroll(scrollx,scrolly)
}
</script>

<META content="MSHTML 6.00.2800.1498" name=GENERATOR>
<STYLE type=text/css>BODY {
MARGIN: 0px
}
.ing {
border: 1px solid #999999;
}
</STYLE>
</HEAD>
<BODY>
<span title="向上" onMouseDown=movover();movstar(-3,2) onMouseOut=movover() onMouseOver=movstar(-1,20); onMouseUp=movover();movstar(-1,20) style="cursor:crosshair">向上移动</span> <span title="向下" onMouseDown=movover();movstar(3,2) onMouseOut=movover() onMouseOver=movstar(1,20) onMouseUp=movover();movstar(1,20) style="cursor:crosshair">向下移动</span> <span title="向左" onMouseDown=movover2();movstar2(-3,2) onMouseOut=movover2() onMouseOver=movstar2(-1,20); onMouseUp=movover2();movstar2(-1,20) style="cursor:crosshair">向左移动</span> <span title="向右" onMouseDown=movover2();movstar2(3,2) onMouseOut=movover2() onMouseOver=movstar2(1,20) onMouseUp=movover2();movstar2(1,20)style="cursor:crosshair">向右移动</span>
<br>
<iframe border=0 frameborder=0 framespacing=0 height=110 marginheight=0 marginwidth=0 name=win1 id=win1 scrolling=no src="adtxt1.htm" width=376 vspale="0"></iframe>

</BODY>
</HTML>

注意:adtxt1.htm文件里最好不要包含<html><body>标签.

TOP

发新话题