文档滚动

1、在<head>与</head>之间插入以下代码:
<SCRIPT>
<!--
function movstar(a,time){
movx=setInterval("mov("+a+")",10)
}
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(theopacity){
opacity=theopacity
while(opacity>60){
opacity+=-10}
}
function o_up(theopacity){
opacity=theopacity
while(opacity<100){
opacity+=10}
}
function wback(){
if(new_date.history.length==0){window.history.back()}
else{new_date.history.back()}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</SCRIPT>

2、在单元格中插入以下代码:
<table width="400" border="0" cellspacing="0" cellpadding="0" height="100" align="center">
<tr>
<td height="100" width="400"><iframe border=0 frameborder=0 framespacing=0 height='100%' marginheight=0 marginwidth=0 name=new_date noResize scrolling=no src="about.htm" width='100%' vspale="0"></iframe></td>
<td width="10"> <table width="8" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td><a href="javascript:"><img onMouseDown=movover();movstar(-8,2)
onMouseOut=movover()
onMouseOver=movstar(-1,20)
onMouseUp=movover();movstar(-1,20) height=11
src="../img/up.gif" width=11 border=0 alt=":::向上:::"></a></td>
</tr>
<tr>
<td background="../img/line.gif" height="100">&nbsp;</td>
</tr>
<tr>
<td><a href="javascript:"><img src="../img/down.gif" onMouseDown=movover();movstar(8,2)
onMouseOut=movover()
onMouseOver=movstar(1,20)
onMouseUp=movover();movstar(1,20) width="11" height="11" alt=":::向下:::" border="0"></a></td>
</tr>
</table></td>
</tr>
</table>

3、将文字内容写在about.htm文档内
 
 
解说:将鼠标放到向下图标,文字自己滚动,显示下文;将鼠标移到向上图标,文字自己滚动,显示上文;上文中加红色字的地方适当改成自己所需的值;

posted @ 2007-04-20 14:57  Edward Xie  阅读(173)  评论(0编辑  收藏  举报