上下循环滚动代码JAVASCRIPT
上下循环滚动代码JAVASCRIPT
1
<table width="300" border="0" align="center" cellpadding="0" cellspacing="0">
2
<tr>
3
<td>
4
<DIV id=marquees>
5
<table width="300" border=0 cellpadding="1" cellSpacing=1 rules=all style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-COLLAPSE: collapse; BORDER-RIGHT-WIDTH: 0px">
6
<tr class="tablectstyle">
7
<td>5782888</td>
8
<td> 2006-01-17 15:00:40 </td>
9
<td> 苹果皮带 </td>
10
</tr>
11
<tr class="tablectstyle">
12
<td>活在别处</td>
13
<td> 2006-01-17 14:51:37 </td>
14
<td> 苹果皮带 </td>
15
</tr>
16
<tr class="tablectstyle">
17
<td>西即2002</td>
18
<td> 2006-01-17 12:21:16 </td>
19
<td> 电磁炉 </td>
20
</tr>
21
<tr class="tablectstyle">
22
<td>烟茶最好</td>
23
<td> 2006-01-17 12:06:13 </td>
24
<td> 电吹风 </td>
25
</tr>
26
<tr class="tablectstyle">
27
<td>城市大穷人</td>
28
<td> 2006-01-17 09:26:23 </td>
29
<td> 电吹风 </td>
30
</tr>
31
<tr class="tablectstyle">
32
<td>B6365</td>
33
<td> 2006-01-17 09:12:33 </td>
34
<td> 电吹风 </td>
35
</tr>
36
<tr class="tablectstyle">
37
<td>qsxt8815</td>
38
<td> 2006-01-16 20:53:18 </td>
39
<td> 电吹风 </td>
40
</tr>
41
<tr class="tablectstyle">
42
<td>435266021</td>
43
<td> 2006-01-16 20:38:13 </td>
44
<td> 电热水壶 </td>
45
</tr>
46
<tr class="tablectstyle">
47
<td>冰魂shmily</td>
48
<td> 2006-01-16 19:50:56 </td>
49
<td> 电磁炉 </td>
50
</tr>
51
<tr class="tablectstyle">
52
<td>小君儿96</td>
53
<td> 2006-01-16 19:13:32 </td>
54
<td> 电吹风 </td>
55
</tr>
56
</table>
57
</DIV>
58
<SCRIPT language=JavaScript>
59![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
60
marqueesHeight=130;
61
stopscroll=false;
62![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
63
with(marquees){
64
style.width=0;
65
style.height=marqueesHeight;
66
style.overflowX="visible";
67
style.overflowY="hidden";
68
noWrap=true;
69
onmouseover=new Function("stopscroll=true");
70
onmouseout=new Function("stopscroll=false");
71
}
72
document.write('<div id="templayer" style="position:absolute;z-index:1;visibility:hidden"></div>');
73![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
74
preTop=0; currentTop=0;
75![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
76
function init(){
77
templayer.innerHTML="";
78
while(templayer.offsetHeight<marqueesHeight){
79
templayer.innerHTML+=marquees.innerHTML;
80
}
81
marquees.innerHTML=templayer.innerHTML+templayer.innerHTML;
82
setInterval("scrollUp()",30);
83
}
84
document.body.onload=init;
85![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
86
function scrollUp(){
87
if(stopscroll==true) return;
88
preTop=marquees.scrollTop;
89
marquees.scrollTop+=1;
90
if(preTop==marquees.scrollTop){
91
marquees.scrollTop=templayer.offsetHeight-marqueesHeight;
92
marquees.scrollTop+=1;
93
}
94
}
95
</SCRIPT>
96
</td>
97
</tr>
98
</table>
99![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
2
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
3
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
4
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
5
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
6
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
7
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
8
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
9
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
10
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
11
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
12
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
13
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
14
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
15
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
16
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
17
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
18
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
19
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
20
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
21
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
22
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
23
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
24
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
25
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
26
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
27
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
28
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
29
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
30
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
31
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
32
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
33
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
34
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
35
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
36
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
37
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
38
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
39
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
40
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
41
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
42
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
43
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
44
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
45
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
46
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
47
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
48
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
49
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
50
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
51
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
52
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
53
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
54
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
55
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
56
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
57
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
58
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
59
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
60
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
61
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
62
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
63
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
64
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
65
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
66
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
67
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
68
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
69
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
70
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
71
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
72
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
73
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
74
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
75
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
76
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
77
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
78
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
79
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
80
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
81
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
82
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
83
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
84
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
85
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
86
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
87
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
88
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
89
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
90
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
91
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
92
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
93
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
94
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
95
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif)
96
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
97
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
98
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
99
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)