Achieve the marquee Effect

Source: Internet
Author: User





<TD id = "header_demo1" nowrap><! -- Rolling headlines --><A href = ""> Financial Management for newly married couples </a> <a href = ""> original serialization ----- financial management story of 70 male and 80 female cohabitation (2) </a> <a href = ""> A dreamer </a><A href = ""> Financial live broadcasting room </a> <a href = ""> target audience </a><TD id = "header_demo2" nowrap>

Achieve the effect of Marquee at the beginning and end, and completely display the content at the beginning. Instead of moving from the left!
Sometimes similar effects are required! Released.
Code highlighting produced by actipro codehighlighter (freeware) http://www.CodeHighlighter.com/--> <HTML>
<Title> simulate marquee to achieve the moving effect of the first and last connections </title>
<Head>
<Style>
. Col_kx {overflow: hidden; width: 700px}
</Style>
</Head>
<Body>

<Div id = "header_demo" class = "col_kx">
<Table border = "0" cellspacing = "0" cellpadding = "0">

<SCRIPT>

// Rolling headlines
// Scroll Effect
VaR header_demo = Document. getelementbyid ("header_demo ");
VaR header_demo1 = Document. getelementbyid ("header_demo1 ");
VaR header_demo2 = Document. getelementbyid ("header_demo2 ");
VaR speed = 20; // a greater value indicates a slower rolling speed.
Header_demo2.innerhtml = header_demo1.innerhtml;

// Total header_demo2.offsetwidth width
Alert (header_demo2.offsetwidth + "-" + header_demo.scrollleft );

Function marquee (){
If (header_demo2.offsetWidth-header_demo.scrollLeft <= 0)
Header_demo.scrollleft-= header_demo1.offsetwidth
Else {
Header_demo.scrollleft ++
}
}
VaR mymar = setinterval (marquee, speed );
Header_demo.onmouseover = function () {clearinterval (mymar )}
Header_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.