急!!在线!!怎么样在一个网页内加入一个块,用按钮控制这个块中的内容上下滚动??

<<怎么样在一个网页内加入一个块,
<<用两个按钮分别控制这个块中的内容上下滚动??
---------------------------------------------------------------

 1<script language="javascript">   
 2<!--   
 3function moveup(){   
 4div3.style.posTop -= 1;   
 5if(div3.style.posTop <= div1.offsetHeight-div3.offsetHeight){   
 6clsmove(mov);   
 7}   
 8}   
 9  
10function movedown(){   
11div3.style.posTop +=1;   
12if(div3.style.posTop >= 0){   
13clsmove(mov);   
14}   
15}   
16  
17function move(d){   
18mov=setInterval("move"+d+"()",10);   
19}   
20  
21function clsmove(){   
22clearInterval(mov);   
23}   
24//-->   
25</script>
 1<table align="center" border="0" cellpadding="5" cellspacing="0">
 2<tr>
 3<td style="border-right:#a0a0a0 1px solid" valign="top" width="20"><a href="#" onclick="javascript:BNX_showHideTables('tblPublic','block','tblReply','none');MM_showHideLayers('overDiv','','show');BNX_postInit()" onfocus="this.blur()"><img border="0" src="../images/pic01.gif"/></a></td>
 4<td width="434">
 5<div class="main" id="div1">
 6<div class="main2" id="div3">   
 7内容   
 8</div>
 9</div>
10</td>
11<td valign="bottom" width="10">
12<img border="0" onmouseout="clsmove()" onmouseover='move("down")' src="../images/arrow1.gif"/><br/>
13<img border="0" onmouseout="clsmove()" onmouseover='move("up")' src="../images/arrow2.gif"/>
14</td>   
15\---------------------------------------------------------------   
16  
17这个比较简单的了   
18你可以使用一个iframe   
19使用改iframe的scroll()就可以了   
20不过我一般喜欢用flash来做   
21更简单一些   
22\---------------------------------------------------------------   
23  
24最后加上这三句   
25<script>var timer</script>
26<input onmouseout="clearInterval(timer)" onmouseover="timer=setInterval('hotnews.scrollTop++',10)" type="button" value="up"/>
27<input onmouseout="clearInterval(timer)" onmouseover="timer=setInterval('hotnews.scrollTop--',10)" type="button" value="down"/></tr></table>
Published At
Categories with Web编程
comments powered by Disqus