文字向上移动

时间:2013-08-16 16:10:01  来源:第二电脑网  作者:第二电脑网

  第二电脑网导读:12:hover {font-size:12px;color:#000000;text-decoration:underline;} a.black12line:link {font-size:12px;color:#000000;text-decoration:underline;} a.black12line:visited {font-size:12px;color:#000000;text-decoration:underline;} a.black12line:hover {font-size:12px;color:#000000;text-decoration:none;} </style>
  正文:<style>
.black12 {font-size:12px;color:#000000;}
a.black12:link {font-size:12px;color:#000000;text-decoration:none;}
a.black12:visited {font-size:12px;color:#000000;text-decoration:none;}
a.black12:hover {font-size:12px;color:#000000;text-decoration:underline;}
a.black12line:link {font-size:12px;color:#000000;text-decoration:underline;}
a.black12line:visited {font-size:12px;color:#000000;text-decoration:underline;}
a.black12line:hover {font-size:12px;color:#000000;text-decoration:none;}
</style>
<TABLE border=1 width=200>
<TR>
 <TD>
<div id="marquees">
<div class="details">
<a href='http://www.sina.com.cn' target='_blank' class="black12 blackDot"><li>新浪</li></a>
<a href='http://www.baidu.com' target='_blank' class="black12 blackDot"><li>百度</li></a>
<a href='http://www.Google.com' target='_blank' class="black12 blackDot"><li>google</li></a>
<a href='http://www.yahoo.com.cn' target='_blank' class="black12 blackDot"><li>雅虎</li></a>
<a href='http://www.163.com' target='_blank' class="black12 blackDot"><li>网易</li></a>
<a href='http://www.sohu.com' target='_blank' class="black12 blackDot"><li>搜狐</li></a>
</div>
</div>
</TD>
</TR>
</TABLE>
<script language="JavaScript">
marqueesHeight=100;
stophotoshop/ target=_blank class=infotextkey>pscroll=false;
with(document.getElementById("marquees")){
 style.width=0;
 style.height=marqueesHeight;
 style.overflowX="visible";
 style.overflowY="hidden";
 noWrap=true;
 onmouSEOver=new Function("stopscroll=true");
 onmouseout=new Function("stopscroll=false");
}
document.write('<div id="templayer" style="position:absolute;z-index:1;visibility:hidden"></div>');

preTop=0; currentTop=0;

function init(){
document.getElementById("templayer").innerHTML="";
while(document.getElementById("templayer").offsetHeight<marqueesHeight){
document.getElementById("templayer").innerHTML+=document.getElementById("marquees").innerHTML;
}
document.getElementById("marquees").innerHTML=document.getElementById("templayer").innerHTML+document.getElementById("templayer").innerHTML;
setInterval("scrollUp()",30);
}
document.body.onload=init;

function scrollUp(){
if(stopscroll==true) return;
preTop=document.getElementById("marquees").scrollTop;
document.getElementById("marquees").scrollTop+=1;
if(preTop==document.getElementById("marquees").scrollTop){
document.getElementById("marquees").scrollTop=document.getElementById("templayer").offsetHeight-marqueesHeight;
document.getElementById("marquees").scrollTop+=1;
}
}
</script>

"文字向上移动"由第二电脑网原创提供,转载请注明:http://www.002pc.com/master/College/Programming/JavaScript/26458.html


关于《文字向上移动》文章的评论

站内搜索: 高级搜索

热门搜索: Windows style 系统 tr IP QQ CPU 安装 function 注册 if td