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">
|
<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>
<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>