The code is continuously rolled from the left and right sides of the image to solve the white space problem of Marquee.

Source: Internet
Author: User

Up:
<Base

Href = "http://image2.sina.com.cn/gm/lineage2/whz/newwh/images/fy/images/images/ifimage/">

<Div id = demo style = "overflow: hidden; width: 128px; Height: 300px;">
<Div id = demo1>
<br> <br> <br>
<br> <br> <br>
<br> <br> <br>
<br> <br> <br>
<br> <br> <br>
<br> <br> <br>
<br> <br> <br>
<br> <br> <br>
<br> <br> <br>
<br> <br> <br>
<br> <br> <br>
</Div>
<Div id = demo2> </div>
</Div>
<Script language = "JavaScript">
VaR speed = 30
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>

Down:
<Base

Href = "http://image2.sina.com.cn/gm/lineage2/whz/newwh/images/fy/images/images/ifimage/">

<Div id = demo style = "overflow: hidden; width: 128px; Height: 300px;">
<Div id = demo1>
<br> <br> <br>
<br> <br> <br>
<br> <br> <br>
<br> <br> <br>
<br> <br> <br>
<br> <br> <br>
<br> <br> <br>
<br> <br> <br>
<br> <br> <br>
<br> <br> <br>
<br> <br> <br>
</Div>
<Div id = demo2> </div>
</Div>
<Script language = "JavaScript">
VaR speed = 30
Demo2.innerhtml = demo1.innerhtml
Demo. scrolltop = demo. scrollheight
Function marquee (){
If (demo1.offsettop-demo. scrolltop> = 0)
Demo. scrolltop + = demo2.offsetheight
Else {
Demo. scrolltop --
}
}
VaR mymar = setinterval (marquee, speed)
Demo. onmouseover = function () {clearinterval (mymar )}
Demo. onmouseout = function () {mymar = setinterval (marquee, speed )}
</SCRIPT>

Left:
<Base

Href = "http://image2.sina.com.cn/gm/lineage2/whz/newwh/images/fy/images/images/ifimage/">
<Div id = demo style = "overflow: hidden; Height: 100px; width: 300px;"> <Table align = left

Cellpadding = 0 cellspace = 0 border = 0> <tr> <TD id = demo1 valign = top>

Src = "bxtt.gif">

Src = "bzjd.gif"> </TD> <TD id = demo2 valign = top> </TD> </tr> </table> </div>
<SCRIPT>
VaR speed = 30
Demo2.innerhtml = demo1.innerhtml
Function marquee (){
If (demo2.offsetwidth-demo. scrollleft <= 0)
Demo. scrollleft-= demo1.offsetwidth
Else {
Demo. scrollleft ++
}
}
VaR mymar = setinterval (marquee, speed)
Demo. onmouseover = function () {clearinterval (mymar )}
Demo. onmouseout = function () {mymar = setinterval (marquee, speed )}
</SCRIPT>

Right:
<Base

Href = "http://image2.sina.com.cn/gm/lineage2/whz/newwh/images/fy/images/images/ifimage/">
<Div id = demo style = "overflow: hidden; Height: 100px; width: 300px;"> <Table align = left

Cellpadding = 0 cellspace = 0 border = 0> <tr> <TD id = demo1 valign = top>

Src = "bxtt.gif">

Src = "bzjd.gif"> </TD> <TD id = demo2 valign = top> </TD> </tr> </table> </div>
<SCRIPT>
VaR speed = 30
Demo2.innerhtml = demo1.innerhtml
Demo. scrollleft = demo. scrollwidth
Function marquee (){
If (Demo. scrollleft <= 0)
Demo. scrollleft + = demo2.offsetwidth
Else {
Demo. scrollleft --
}
}
VaR mymar = setinterval (marquee, speed)
Demo. onmouseover = function () {clearinterval (mymar )}
Demo. onmouseout = function () {mymar = setinterval (marquee, speed )}
</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.