142、文字向上滚动

142、文字向上滚动

脚本说明:

第一步:把如下代码加入<body>区域中

<STYLE type=text/css>

#divASContainer {

       CLIP: rect(0px 320px 120px 0px); HEIGHT: 120px; LEFT: 10px; OVERFLOW: hidden; POSITION: absolute; TOP: 10px; VISIBILITY: hidden; WIDTH: 250px

}

#divASContent {

       LEFT: 0px; POSITION: absolute; TOP: 0px

}

BODY {

       FONT: 11px Tahoma, Arial, Helvetica, sans-serif

}

DIV {

       FONT: 11px Tahoma, Arial, Helvetica, sans-serif

}

</STYLE>

 

<SCRIPT language=JavaScript>

// begin absolutely positioned scrollable area object scripts

function verifyCompatibleBrowser(){

       this.ver=navigator.appVersion

       this.dom=document.getElementById?1:0

       this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;

       this.ie4=(document.all && !this.dom)?1:0;

       this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;

       this.ns4=(document.layers && !this.dom)?1:0;

       this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)

       return this

}

bw=new verifyCompatibleBrowser()

lstart=120

loop=true 

speed=50

pr_step=3

function ConstructObject(obj,nest){

    nest=(!nest) ? '':'document.'+nest+'.'

       this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0;

      this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0;

       this.scrollHeight=bw.ns4?this.css.document.height:this.el.offsetHeight

       this.newsScroll=newsScroll;

       this.moveIt=b_moveIt; this.x; this.y;

    this.obj = obj + "Object"

    eval(this.obj + "=this")

    return this

}

function b_moveIt(x,y){

       this.x=x;this.y=y

       this.css.left=this.x

       this.css.top=this.y

}

//Makes the object scroll up

function newsScroll(speed){

       if(this.y>-this.scrollHeight){

              this.moveIt(0,this.y-pr_step)

              setTimeout(this.obj+".newsScroll("+speed+")",speed)

       }else if(loop) {

              this.moveIt(0,lstart)

              eval(this.obj+".newsScroll("+speed+")")

         }

}

//Makes the object

function InitialiseAutoScrollArea(){

       objContainer=new ConstructObject('divASContainer')

       objContent=new ConstructObject('divASContent','divASContainer')

       objContent.moveIt(0,lstart)

       objContainer.css.visibility='visible'

       objContent.newsScroll(speed)

}

// end absolutely positioned scrollable area object scripts

 

</SCRIPT>

<DIV id=divASContainer>

<DIV id=divASContent><B>Scroll Area Content Start</B>

    <P>Lorem ipsum dolor sit amet,

      consectetur adipscing elit, sed diam nonnumy eiusmod tempor incidunt ut

      labore et dolore magna aliquam erat volupat.</P>

<P>Et harumd dereud facilis est er expedit distinct. Nam liber a tempor cum

soluta nobis eligend optio comque nihil quod a impedit anim id quod maxim

placeat facer possim omnis es voluptas assumenda est, omnis dolor repellend.

Temporem autem quinsud et aur office debit aut tum rerum necesit atib saepe

eveniet ut er repudiand sint et molestia non este recusand.</P>

<P>Lorem ipsum dolor sit amet, consectetur adipscing elit, sed diam nonnumy

eiusmod tempor incidunt ut labore et dolore magna aliquam erat volupat.</P>

<P>Et harumd dereud facilis est er expedit distinct. Nam liber a tempor cum

soluta nobis eligend optio comque nihil quod a impedit anim id quod maxim

placeat facer possim omnis es voluptas assumenda est, omnis dolor repellend.

Temporem autem quinsud et aur office debit aut tum rerum necesit atib saepe

eveniet ut er repudiand sint et molestia non este recusand.</P><B>Scroll Area

Content End</B> </DIV></DIV>

 

 

第二步:把<body>中的内容改为:

<body bgcolor="#fef4d9" onload=InitialiseAutoScrollArea(); onBlur="self.close()">

 

Write a comment

Comments: 0