如何自动滚动从下到上? [英] how to make auto scroll from down to up?

查看:75
本文介绍了如何自动滚动从下到上?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望完整的代码包含aspx页面,html页面,css,java脚本等。

i want full code with aspx page, html page, css, java script, etc..

推荐答案

style =overflow:auto



这个语法放在任何控件上你会自动滚动。



谢谢
style="overflow:auto"

this syntax put on any control and you will get auto scrolling.

Thanks


请尝试使用以下代码。



Please try with below code.

<SCRIPT language=JavaScript1.2>
//change 1 to another integer to alter the scroll speed. Greater is faster

var speed=1

var currentpos=0,alt=1,curpos1=0,curpos2=-1

function initialize(){

startit()

}

function scrollwindow(){

if (document.all &&

!document.getElementById)

temp=document.body.scrollTop

else

temp=window.pageYOffset

if (alt==0)

alt=2

else

alt=1

if (alt==0)

curpos1=temp

else

curpos2=temp

if (curpos1!=curpos2){

if (document.all)

currentpos=document.body.scrollTop+speed

else

currentpos=window.pageYOffset+speed

window.scroll(0,currentpos)

}

else{

currentpos=0

window.scroll(0,currentpos)

}

}

function startit(){

setInterval("scrollwindow()",50)

}

window.onload=initialize

</SCRIPT>





点击此处查看更多信息: 用于自动滚动的Java脚本


这篇关于如何自动滚动从下到上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆