The example in this article describes how to implement text scrolling down with JS. Share it with everyone for your reference. The specific implementation method is as follows:
@charset "utf-8";
/*
@name: base
@Function: Reset browser default style
*/
/* Prevent the impact of user-defined background color on web pages, and add users to customize fonts */
html{
Color:#000;background:#fff;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
/* Internal and external margins usually cause different browser styles to appear in different positions */
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td, hr,button,arti
cle,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section {
Margin:0;padding:0;
Color:#333;
}
/* Reset HTML5 tag, IE needs to createElement(TAG) in js */
article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section {
display:block;
}
/* HTML5 media files are consistent with img */
audio,canvas,video {
display: inline-block;*display: inline;*zoom: 1;
}
/* Please note that form elements do not inherit the parent font */
body,button,input,select,textarea{
font:12px/1.5 tahoma,arial,\5b8b\4f53;
}
input,select,textarea{
font-size:100%;
}
/* Remove the margins of each Table cell and make their sides overlap */
table{
border-collapse:collapse;border-spacing:0;
}
/* IE bug fixed: th does not inherit text-align*/
th{
text-align:inherit;
}
/* Remove default borders */
fieldset,img{
border:0;
}
/* ie6 7 8(q) bug is displayed as inline behavior */
iframe{
display:block;
}
/* Remove the border of this element under firefox */
abbr,acronym{
border:0;font-variant:normal;
}
/* Consistent del style */
del {
text-decoration:line-through;
}
address,caption,cite,code,dfn,em,th,var {
font-style:normal;
font-weight:500;
}
/* Remove the identifier before the list, li will inherit */
ol,ul {
list-style:none;
}
/* Alignment is the most important factor in layout, don’t let everything be centered */
caption,th {
text-align:left;
}
/* From yahoo, the title can be customized to adapt to multiple system applications */
h1,h2,h3,h4,h5,h6 {
font-size:100%;
font-weight:500;
}
q:before,q:after {
content:'';
}
/* Unify superscript and subscript */
sub, sup {
font-size: 75%; line-height: 0; position: relative; vertical-align: baseline;
}
sup {top: -0.5em;}
sub {bottom: -0.25em;}
a{
Color: #333;
}
/* Make the link appear underlined in the hover state */
a:hover {
text-decoration:underline;
Color: #c00;
}
/* Underlines are not displayed by default to keep the page simple */
ins,a {
text-decoration:none;
}
/* Clean up floats */
.fn-clear:after {
visibility:hidden;
display:block;
font-size:0;
content:" ";
clear:both;
height:0;
}
.fn-clear {
zoom:1; /* for IE6 IE7 */
}
/* Hidden, usually used with JS */
body .fn-hide {
display:none;
}
/* 设置内联, 减少浮动带来的bug */
.fn-left,.fn-right {
display:inline;
}
.fn-left {
float:left;
}
.fn-right {
float:right;
}
#club{width:888px;height:190px;margin:40px auto;border:1px solid #dddddd;border-radius:5px 5px 0px 0px;}
#club .modle{width:443px;height:190px;border-right:1px solid #dddddd;float:left;}
#club .modle_right{border-right:none;float:right;}
#club .modle .modle_title{width:443px;height:29px;line-height:29px;font-size:12px;font-weight:bold;background:#f3f3f3;}
#club .modle .modle_title span{padding-left:7px;}
#club .modle .modle_con{width:423px;margin:0 auto;height:160px;overflow:hidden;}
#club .modle .modle_con ul li{border-bottom:1px #DDD dotted;position:relative;}
#club .modle .modle_con .modle_img{width:50px;height:79px;text-align:center;}
#club .modle .modle_con .modle_img img{margin-top:14px;}
#club .modle .modle_con .modle_img i{display:block;width:15px;height:17px;background:url(../image/buy.png)no-repeat;position:absolute;top:10px;left:60px;}
#club .modle .modle_con .modle_text{width:337px;height:60px;overflow:hidden;margin-top:15px;padding-left:8px;}
#club .modle .modle_con .modle_text p a{color:#005ea7;}
#club .modle .modle_con .modle_text div a{color:#999999;}
I hope this article will be helpful to everyone’s JavaScript programming design.