用window.scrollTo()和setTimeout()即可实现
解决方案 »
- 关于浏览器拦截弹出窗口的问题(谢谢帮忙!)
- window.open中的status=1,为什么还是不显示状态栏啊?求解
- 在.js里面怎么实现自动补全
- iframe 如何在parent 获取自己
- javascript的replace的怪问题2
- 如何验证形如2006-12-20的字符串是一合法的日期?
- 怎样给一个id为'foodDiv'的div下面的所有checkbox打上勾?
- 怎么样可以得到帧中所加载的文件的名称
- 在js中有没有办法获取一个变量的名字啊?比如说:var _Flat_Theme = new Object(); 使用一个函数 fnGetVarName(_Flat_Theme) 就能够返回
- 用#default#time简化编程
- 我认为很难的问题,也许对于你来说很easy~~~~
- 请教孟子:这个问题有点差异,我搜索了一下没有答案
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>JS资源</title><style type="text/css">
<!--
.opacity {
FILTER: alpha(opacity=100)
}
td,p,font{font-size:13px;}
input{border: 1px #000000 solid; cursor: 默认;}
.campo { letter-spacing: 3px}
.input1 { border: 1px #000000 ridge; cursor: hand; height:17px}
A{COLOR: #006790; FONT-FAMILY: 宋体; TEXT-DECORATION: none}
A:active {COLOR: #006790; FONT-FAMILY: 宋体; TEXT-DECORATION: underline overline}
A:hover {COLOR: #000000; FONT-FAMILY: 宋体; TEXT-DECORATION: underline overline}
BODY{FONT-FAMILY: 宋体; FONT-SIZE: 9pt;
SCROLLBAR-HIGHLIGHT-COLOR: buttonface;
SCROLLBAR-SHADOW-COLOR: buttonface;
SCROLLBAR-3DLIGHT-COLOR: buttonhighlight;
SCROLLBAR-TRACK-COLOR: #eeeeee;
SCROLLBAR-DARKSHADOW-COLOR: buttonshadow}
-->
</style>
<SCRIPT>
function movX(a){
scrollx=new_date.document.body.scrollLeft
scrolly=new_date.document.body.scrollTop
scrollx=scrollx+a
new_date.window.scroll(scrollx,scrolly)
}
function movstarX(a,time){
movY=setInterval("movX("+a+")",10)
}
function movstar(a,time){
movx=setInterval("mov("+a+")",10)
}
function movover(){
clearInterval(movx)
}
function movoverY(o){
clearInterval(o)
}
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}
}
</SCRIPT>
</head>
<body bgcolor="#FFFFFF" >
<form method=Get action='maintype.asp'>
<div align="center">
<table border="0" cellspacing="0" cellpadding="0" height="218" align="center">
<tr>
<center>
<td height="173" rowspan="3" valign="middle"> </td>
</center>
<td height="161" width="300" rowspan="2" valign="middle" style="border: 1 solid #737373" colspan="3">
<iframe
border=0 frameborder=0 framespacing=0 height=100% marginheight=0
marginwidth=0 name=new_date noResize scrolling=no
src="biaodan1.htm" width=100% vspale="0"> </iframe> </td>
<center>
<td height="1" width="10"><a href="javascript:void(0)" class=opacity onMouseDown=movover();movstar(-3,2)
onMouseOut=movover();o_up(this) onMouseOver=movstar(-1,20);o_down(this)
onMouseUp=movover();movstar(-1,20)>up</a></td>
</center>
</tr>
<tr>
<td height="163" width="10"> </td>
</tr>
<tr>
<td height="12" width="10" valign="middle" style="border:0 solid #737373" onmouseover="movstarX(1,10)" onmouseout="movoverY(movY)">p
</td>
<td height="12" width="280" valign="middle" style="border:0 solid #737373"> </td>
<td height="12" width="10" valign="middle" style="border:0 solid #737373" onmouseover="movstarX(-1,10)" onmouseout="movoverY(movY)">p
</td>
<td height="12" width="10"><a href="###" class=opacity
onMouseDown=movover();movstar(3,2) onMouseOut=movover();o_up(this)
onMouseOver=movstar(1,20);o_down(this) onMouseUp=movover();movstar(1,20)>down</a></td>
</tr>
</table>
</div>
</form>
</body>
</html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title><style type="text/css">.button {
background: ButtonFace;
border: 1px solid ButtonShadow;
border-left: 0;
border-right: 0;
}.scrollButton {
font-family: Webdings;
color: blue;
text-align: center;
cursor: hand;
}#scrollContainer {
height: 100%;
overflow: hidden;
padding: 0px;
}.border {
border-left: 1px solid ButtonShadow;
border-right: 1px solid ButtonShadow;
width: 200px;
}
</style>
</head>
<script language="javascript">
/*
功能:滚动*/
function ScrollButton( oEl, oScrollContainer, nDir ) {
this.htmlElement = oEl;
this.scrollContainer = oScrollContainer;
this.dir = nDir;
var oThis = this;
oEl.onmouseover=function(){oThis.startScroll()} //捕作事件
oEl.onmouseout=function(){oThis.endScroll()}}ScrollButton.scrollIntervalPause = 100;
ScrollButton.scrollAmount = 18;ScrollButton.prototype.startScroll = function () {
var oThis = this;
this._interval = window.setInterval( function () {
switch ( oThis.dir ) {
case 8:
oThis.scrollContainer.scrollTop -= ScrollButton.scrollAmount;
break;
case 2:
oThis.scrollContainer.scrollTop += ScrollButton.scrollAmount;
break;
case 4:
oThis.scrollContainer.scrollLeft -= ScrollButton.scrollAmount;
break;
case 6:
oThis.scrollContainer.scrollLeft += ScrollButton.scrollAmount;
break;
}
}, ScrollButton.scrollIntervalPause );
};ScrollButton.prototype.endScroll = function () {
if ( this._interval != null ) {
window.clearInterval( this._interval ); //结束滚动
this._interval=null;
}
};</script><body id="bdy" topmargin="0" leftmargin="0" scroll="no" onselectstart="javascript:return false" ondragstart="javascript:return false" oncontextmenu="javascript:return false">
<center>
<table align="center" width="100%" height="100%" border=0><tr><td align="center" rowspan=2><div id="scrollContainer">
在这个层里添加你的内容!其他的地方不动!<br><br><Br>
在这个层里添加你的内容!其他的地方不动!<br><br><Br>
在这个层里添加你的内容!其他的地方不动!<br><br><Br>
在这个层里添加你的内容!其他的地方不动!<br><br><Br>
在这个层里添加你的内容!其他的地方不动!<br><br><Br>
在这个层里添加你的内容!其他的地方不动!<br><br><Br>
在这个层里添加你的内容!其他的地方不动!<br><br><Br>
在这个层里添加你的内容!其他的地方不动!<br><br><Br>
在这个层里添加你的内容!其他的地方不动!<br><br><Br>
</div> </td>
<td width=16 valign="top">
<div class="scrollButton" id="upScrollButton">5</div>
</td>
</tr>
<tr><td width=16 valign="bottom">
<div class="scrollButton" id="downScrollButton">6</div>
</td></tr>
</table><script type="text/javascript">ScrollButton.scrollIntervalPause = 50; //
ScrollButton.scrollAmount = 5;var upScrollButton = document.getElementById( "upScrollButton" );
var downScrollButton = document.getElementById( "downScrollButton" );
var scrollContainer = document.getElementById( "scrollContainer" );
//var bodyObj=document.getElementById( "body" );new ScrollButton( upScrollButton, scrollContainer, 8 );
new ScrollButton( downScrollButton, scrollContainer, 2 );</script>
</body>
</html>
在按上去的情况下,改什么地方的参数才能使滚动速度变快呢??