这几天一直在研究这个问题——区域滚动代码怎么才可以在同一个页面同时使用面不影响。
问题是这样的,我想用代码来控制两个iframe页面竖向滚动,两个相互不影响。就是我在控制左边iframe时,右边iframe不动,控制右边iframe时,左边iframe不动。
代码是这样的
<table width="510" border="0" align="center" cellpadding="0" cellspacing="0" class="solid-top solid-bottom">
<tr>
<td width="480"><iframe src="news-1.htm" name="new_date"
width="480" marginwidth="0" height="150"
marginheight="0" scrolling="No"
frameborder="0" id="new_date" border="0" framespacing="2"
noresize="noresize" vspale="0"></iframe></td>
<td width="30" align="center" valign="top"><br>
<img src="images/scrollup.gif" alt="点住不放可以快速向上滚动"
width="11" height="11" vspace="5" class="opacity"
onMouseDown="movover();movstar(-3,2)"
onMouseUp="movover();movstar(-1,20)"
onMouseOver="movstar(-1,20);o_down(this)"
onMouseOut="movover();o_up(this)" /><br>
<img src="images/scrolldw.gif" alt="点住不放可以快速向下滚动"
width="11" height="11" vspace="5" class="opacity"
onMouseDown="movover();movstar(3,2)"
onMouseUp="movover();movstar(1,20)"
onMouseOver="movstar(1,20);o_down(this)"
onMouseOut="movover();o_up(this)" /> <br>
<script language=JavaScript>
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)
}
function o_down(theobject){
object=theobject
while(object.filters.alpha.opacity>60){
object.filters.alpha.opacity+=-10}
}
function o_up(theobject){
object=theobject
while(object.filters.alpha.opacity<100){
object.filters.alpha.opacity+=10}
}
function wback(){
if(new_date.history.length==0){window.history.back()}
else{new_date.history.back()}
}
</script></td>
</tr>
</table>请高手指点迷津
问题是这样的,我想用代码来控制两个iframe页面竖向滚动,两个相互不影响。就是我在控制左边iframe时,右边iframe不动,控制右边iframe时,左边iframe不动。
代码是这样的
<table width="510" border="0" align="center" cellpadding="0" cellspacing="0" class="solid-top solid-bottom">
<tr>
<td width="480"><iframe src="news-1.htm" name="new_date"
width="480" marginwidth="0" height="150"
marginheight="0" scrolling="No"
frameborder="0" id="new_date" border="0" framespacing="2"
noresize="noresize" vspale="0"></iframe></td>
<td width="30" align="center" valign="top"><br>
<img src="images/scrollup.gif" alt="点住不放可以快速向上滚动"
width="11" height="11" vspace="5" class="opacity"
onMouseDown="movover();movstar(-3,2)"
onMouseUp="movover();movstar(-1,20)"
onMouseOver="movstar(-1,20);o_down(this)"
onMouseOut="movover();o_up(this)" /><br>
<img src="images/scrolldw.gif" alt="点住不放可以快速向下滚动"
width="11" height="11" vspace="5" class="opacity"
onMouseDown="movover();movstar(3,2)"
onMouseUp="movover();movstar(1,20)"
onMouseOver="movstar(1,20);o_down(this)"
onMouseOut="movover();o_up(this)" /> <br>
<script language=JavaScript>
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)
}
function o_down(theobject){
object=theobject
while(object.filters.alpha.opacity>60){
object.filters.alpha.opacity+=-10}
}
function o_up(theobject){
object=theobject
while(object.filters.alpha.opacity<100){
object.filters.alpha.opacity+=10}
}
function wback(){
if(new_date.history.length==0){window.history.back()}
else{new_date.history.back()}
}
</script></td>
</tr>
</table>请高手指点迷津
解决方案 »
- 一个层里有一个表格,当用JS向表格里不断添加列时,如何让层自动出现横向滚动条?而不是压缩已有列的宽度
- ASP.NET JavsScript 获取服务器控件的值
- 请教大师,如何 function t(obj) {取Radio的value,为何老是错误
- 急救。javascript..强人来
- 赋值得不到值!!!
- 网站JS获取QQ是真的假的?如何做到的?
- 简单的问题,关于读写cookie!!!!!在javascript中,
- 谁能帮我把这些vbs函数翻译成jscript的方法或函数?
- 打开新窗口的方法——请先看看要求
- ******怎么使鼠标放上,弹出一页************
- javascript 问题,谢谢先
- 如何获取表格焦点?
马家爵式的人物