Text in HTML is automatically rolled up

Source: Internet
Author: User
<HTML>
<Head>
<Title> Text automatically scroll up </title>
<Meta content = "text/html; charset = gb2312" http-equiv = Content-Type>
<Style type = text/CSS>
# Demo {
Width: 100%;
Overflow: hidden;
Font: 12px/16px tahoma;
Display: block;
Text-Decoration: none;
Margin: 2px;
Color: # 4a551c;
Padding-left: 2px;
Text-align: left;
}
# Demo A: hover {
Color: # ff6600;
}
</Style>
</Head>
<Body>
<Div id = "Demo" style = "overflow: hidden; Height: 132px; width: 400px; Border: 1px solid # dde5bc; margin-left: 300px; margin-top: 100px; ">
<Div id = "demo1">
<A href = "#"> standing by the window, staring at the scattered hair with slight rain </a>
<A href = "#"> it seems that it is also expected </a>
<A href = "#"> expect his appearance </a>
<A href = "#"> happy light rain in the sky </a>
<A href = "#"> the air emits a happy atmosphere </a>
<A href = "#"> her face is filled with happy expectations </a>
<A href = "#"> rain is everywhere </a>
<A href = "#"> the rain turns into raindrops </a>
<A href = "#"> the ground slowly experiences stagnant rain </a>
<A href = "#"> she never showed up. </a>
<A href = "#"> her face is wet </a>
<A href = "#"> she told herself that it was not tears. </a>
<A href = "#"> it's just wet by rain. </a>
<A href = "#"> she remembers </a>
<A href = "#"> remember to spend the rain with her. </a>
<A href = "#"> remember the sunrise and sunset he watched with her. </a>
<A href = "#"> now with her </a>
<A href = "#"> only silent rain </a>
<A href = "#"> raindrops hit her face </a>
<A href = "#"> cool, cold, and cold </a>
</Div>
<Div id = "demo2"> </div>
</Div>
<SCRIPT>
VaR speed = 40
VaR demo = Document. getelementbyid ("Demo ");
VaR demo2 = Document. getelementbyid ("demo2 ");
VaR demo1 = Document. getelementbyid ("demo1 ");
Demo2.innerhtml = demo1.innerhtml
Function marquee (){
If (demo2.offsettop-demo. scrolltop <= 0)
Demo. scrolltop-= demo1.offsetheight
Else {
Demo. scrolltop ++
}
}
VaR mymar = setinterval (marquee, speed)
Demo. onmouseover = function () {clearinterval (mymar )}
Demo. onmouseout = function () {mymar = setinterval (marquee, speed )}
</SCRIPT>
</Body>
</Html>

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.