[JS script implementation] image Scrolling up and pausing Special Effects

Source: Internet
Author: User

[JS script implementation] image Scrolling up and pausing Special Effects

<! -- Set the following Code Put it in <body> middle -->
<Table width = "100%" border = "0" cellpadding = "0" cellspacing = "0">
<Tr>
<TD>
<Table width = "500" border = "0" cellspacing = "0" align = "center">
<Tr> <TD>
<Div id = "Article1" style = "width: 500;">
<! -- Set the image width of a div to the image width -->
<! -- Use a table to accommodate image content -->
<Table cellspacing = "0" cellpadding = "0" width = "500" border = "0">
<Tr> <TD Height = 80 align = center> <a href = http://www.webjx.com target = _ blank> </> </TD>
</Tr> <TD Height = 80 align = center> <a href = http://www.webjx.com target = _ blank> </a> </TD>
</Tr> <TD Height = 80 align = center> <a href = http://www.webjx.com target = _ blank> </a> </TD>
</Tr> <TD Height = 80 align = center> <a href = http://www.webjx.com target = _ blank> </a> </TD>
</Tr> <TD Height = 80 align = center> <a href = http://www.webjx.com target = _ blank> </a> </TD>
</Tr> <TD Height = 80 align = center> <a href = http://www.webjx.com target = _ blank> </a> </TD>
</Tr> <TD Height = 80 align = center> <a href = http://www.webjx.com target = _ blank> </a> </TD>
</Tr> </table>
</Div>
<Div id = "Article2" style = "position: absolute; Z-index: 1; visibility: hidden"> </div>
</TD> </tr>
</Table>

<SCRIPT>
Articleheight = 80; // set it to the image height.
Stopscrolla = false;
Article1.scrolltop = 0;
With (article1 ){
Style. width = 0;
Style. Height = articleheight;
Style. overflowx = "visible ";
Style. overflowy = "hidden ";
Nowrap = true;
Onmouseover = new function ("stopscrolla = true ");
Onmouseout = new function ("stopscrolla = false ");
}

Pretopa = 0; currenttopa = 0; stoptimea = 0;

function init_srolltext1 () {
article2.innerhtml = "";
article2.innerhtml + = article1.innerhtml;
article1.innerhtml = article2.innerhtml + article2.innerhtml;
setinterval ("scrollup1 ()", 1); // image scrolling speed
}< br> function scrollup1 () {
If (stopscrolla = true) return;
currenttopa + = 1;
If (currenttopa = 81) // The image height is slightly higher, prevents left edges after multiple scrolling
{< br> stoptimea + = 1;
currenttopa-= 1;
If (stoptimea = 200) // pause time
{< br> currenttopa = 0;
stoptimea = 0;
}< BR >}< br> else {
pretopa = article1.scrolltop;
article1.scrolltop + = 1;
If (pretopa = article1.scrolltop) {
article1.scrolltop = article2.offsetheight-articleheight;
article1.scrolltop + = 1;
}< BR >}

}< br> init_srolltext1 ();

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.