Three text seamless scrolling code (up or down)

Source: Internet
Author: User
Tags setinterval visibility

<div id= "Marquees" >
<a href= "#" > Have you ever had countless dreams,</a><br>
<br>
<a href= "#" > was disillusioned in the passage of time </a><br>
<br>
<a href= "#" > Did you ever look forward to the future,</a><br>
<br>
<a href= "#" > was lost in the years of growth </a><br>
<br>
</div>
<script language= "Web Effects" >
marqueesheight=200;
Stops tutorial Croll=false;
With (marquees) {
style.width=0;
Style.height=marqueesheight;
style.overflowx= "visible";
Style.overflowy= "hidden";
Nowrap=true;
Onmouseo Tutorial ver=new function ("stopscroll=true");
Onmouseout=new function ("Stopscroll=false");
}
document.write (' <div id= "Templayer" style= "Position:absolute;z-index:1;visibility:hidden" ></div> ");
Pretop=0; Currenttop=0;
function init () {
Templayer.innerhtml= "";
while (Templayer.offsetheight<marqueesheight) {
templayer.innerhtml+=marquees.innerhtml;
}
marquees.innerhtml=templayer.innerhtml+templayer.innerhtml;
SetInterval ("Scrollup ()", 10);
}
Document.body.onload=init;
function Scrollup () {
if (stopscroll==true) return;
Pretop=marquees.scrolltop;
Marquees.scrolltop+=1;
if (pretop==marquees.scrolltop) {
Marquees.scrolltop=templayer.offsetheight-marqueesheight;
Marquees.scrolltop+=1;
}
}
</script>

Text Seamless scrolling Code

<body text= "Red" >
<table border=3><td width=130 height=230 bgcolor= "Cyan" >
<center>
<div Id=demo style=overflow:hidden;height:60px>
<div id=demo1>
111111111111111<br>
222222222222222<br>
333333333333333<br>
444444444444444<br>
555555555555555
</div>
<div id=demo2></div>
<script>
var t=demo.scrolltop
Demo2.innertext=demo1.innertext
function Qswhmarquee () {
if (demo2.offsettop-demo.scrolltop<=0)
Demo.scrolltop-=demo1.offsetheight
Else
demo.scrolltop++
}
SetInterval (qswhmarquee,10)
</script>
</td></table>

Code Three

<div id= "Marquees" >

<a href= "/" target=_blank> tree Show, water live Shi Lun, outside the world, do not construct a spirit </a> <br>
</div>
<script language= "JavaScript" >

marqueesheight=212;
Stopscroll=false;

With (marquees) {
style.width=260;
Style.height=marqueesheight;
style.overflowx= "visible";
Style.overflowy= "hidden";
Nowrap=true;
Onmouseover=new function ("stopscroll=true");
Onmouseout=new function ("Stopscroll=false");
}
document.write (' <div id= "Templayer" style= "Position:absolute;z-index:1;visibility:hidden" ></div> ");

Pretop=0; Currenttop=0;

function init () {
Templayer.innerhtml= "";
while (Templayer.offsetheight<marqueesheight) {
templayer.innerhtml+=marquees.innerhtml;
}
marquees.innerhtml=templayer.innerhtml+templayer.innerhtml;
SetInterval ("Scrollup ()", 50);
}
Document.body.onload=init;

function Scrollup () {
if (stopscroll==true) return;
Pretop=marquees.scrolltop;
Marquees.scrolltop+=1;
if (pretop==marquees.scrolltop) {
Marquees.scrolltop=templayer.offsetheight-marqueesheight;
Marquees.scrolltop+=1;
}
}
</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.