服務(wù)熱線
153 8323 9821
js 代碼:
marqueesHeight=60;
stopscroll=false;
with(makewing){
style.width=0;
style.height=marqueesHeight;
style.overflowX="visible";
style.overflowY="hidden";
noWrap=true;
on
on
}
preTop=0; currentTop=marqueesHeight; stoptime=0;
makewing.innerHTML+=makewing.innerHTML;
function init_srolltext(){
makewing.scrollTop=0;
setInterval("scrollUp()",1);
}init_srolltext();
function scrollUp(){
if(stopscroll==true) return;
currentTop+=1;
if(currentTop==marqueesHeight+1)
{
stoptime+=1;
currentTop-=1;
if(stoptime==300)
{
currentTop=0;
stoptime=0;
}
}
else {
preTop=makewing.scrollTop;
makewing.scrollTop+=1;
if(preTop==makewing.scrollTop){
makewing.scrollTop=marqueesHeight;
makewing.scrollTop+=1;
}
}
}
init_srolltext();
HTML代碼:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta name="Copyright" content="愛JavaS
<meta name="description" content="圖片上下滾動(dòng)代碼,分享個(gè)人的JavaS
<meta content="圖片上下滾動(dòng)代碼演示,圖片上下循環(huán)代碼演示" name="keywords" />
<title>圖片上下滾動(dòng)代碼演示 - 愛JavaS
<style type="text/css">
body {text-align:center}
td {font-size: 12px;text-align:center}
</style>
</head>
<BODY>
<div id=makewing style="height:60">
<table width="778" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="60" bgcolor="#66CCFF">1此處放圖片</td>
</tr>
<tr>
<td height="60" bgcolor="#FFCC66">2此處放圖片</td>
</tr>
<tr>
<td height="60" bgcolor="#99CC66">3此處放圖片</td>
</tr>
<tr>
<td height="60" bgcolor="#66CCFF">4此處放圖片</td>
</tr>
<tr>
<td height="60" bgcolor="#FFCC66">5此處放圖片</td>
</tr>
<tr>
<td height="60" bgcolor="#99CC66">6此處放圖片</td>
</tr>
</table>
<script type="text/javas
</div>
</BODY>
</HTML>