Using JS to achieve the control content of the upward scrolling effect _ form effects

Source: Internet
Author: User
<script language=javascript1.2>
iens6=document.all| | document.getElementById
Ns4=document.layers

Specify speed of scroll (greater=faster)
var speed=10

if (IENS6) {
document.write (' <div id= "container" style= "position:relative;width:600;height:430;border:0px solid Black;o Verflow:hidden ">")
document.write (' <div id= ' content "style=" position:absolute;width:590;left:0;top:0 ">")
}
</SCRIPT>
<script language=javascript1.2>
if (IENS6)
document.write (' </div></div> ')
</SCRIPT>
<script language=javascript1.2>
if (IENS6) {
var Crossobj=document.getelementbyid? document.getElementById ("Content"): document.all.content
var contentheight=crossobj.offsetheight
}
else if (NS4) {
var crossobj=document.nscontainer.document.nscontent
var contentheight=crossobj.clip.height
}

function MoveDown () {
if (Iens6&&parseint (crossobj.style.top) >= (contentheight* (-1) +100))
Crossobj.style.top=parseint (crossobj.style.top)-speed
else if (ns4&&crossobj.top>= (contentheight* (-1) +100))
Crossobj.top-=speed
Movedownvar=settimeout ("MoveDown ()", 100)
}

function MoveUp () {
if (Iens6&&parseint (crossobj.style.top) <=0)
Crossobj.style.top=parseint (crossobj.style.top) +speed
else if (ns4&&crossobj.top<=0)
Crossobj.top+=speed
Moveupvar=settimeout ("MoveUp ()", 100)

}

function Getcontent_height () {
if (IENS6)
Contentheight=crossobj.offsetheight
else if (NS4)
Document.nscontainer.document.nscontent.visibility= "Show"
}
Window.onload=getcontent_height
</SCRIPT>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.