图片向上滚动并且鼠标滑过有停顿的特效代码
作者:我就是个世界
发表于:2008-02-22
[html]
[/html]
[separator]
图片向上滚动并且有停顿的特效
[code]<table width="165" border="0" cellpadding="4" cellspacing="1" bgcolor="B6B191">
<tr>
<td bgcolor="FFFDE8" class="p12h">
<table width="140" border="0" cellspacing="0" align="center">
<tr><td>
<div id="article1" style="width:165;">
<img src="http://myarticle.enet.com.cn/images/2007/1025/1193293759309.jpg"> <BR>
<img src="http://myarticle.enet.com.cn/images/2007/1025/1193293825379.jpg"> <BR>
<img src="http://myarticle.enet.com.cn/images/2007/1025/1193293947469.jpg"> <BR>
<img src="http://myarticle.enet.com.cn/images/2007/1025/1193293979242.jpg"> <BR>
<img src="http://myarticle.enet.com.cn/images/2007/1025/1193294025878.jpg"> <BR>
<img src="http://myarticle.enet.com.cn/images/2007/1025/1193294047979.jpg"> <BR>
<img src="http://myarticle.enet.com.cn/images/2007/1025/1193293979242.jpg"> <BR>
<img src="http://myarticle.enet.com.cn/images/2007/1025/1193294109987.jpg"> <BR>
<img src="http://myarticle.enet.com.cn/images/2007/1025/1193293979242.jpg"> <BR>
<img src="http://myarticle.enet.com.cn/images/2007/1025/1193293979242.jpg"> <BR>
</div>
<div id="article2" style="position:absolute;z-index:1;visibility:hidden"></div>
</td></tr></table>
</td></tr></table>
<script>
articleHeight=300;
stopscrolla=false;
article1.scrollTop=0;
//more javascript from http://cfan.net.cn
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()",50);
}
function scrollUp1(){
if(stopscrolla==true) return;
currentTopa+=1;
if(currentTopa==68)
{
stoptimea+=1;
currentTopa-=1;
if(stoptimea==50)
{
currentTopa=0;
stoptimea=0;
}
}
else {
preTopa=article1.scrollTop;
article1.scrollTop+=1;
if(preTopa==article1.scrollTop){
article1.scrollTop=article2.offsetHeight-articleHeight;
article1.scrollTop+=1;
}
}
}
init_srolltext1();
</script>[/code]
[/html]
[separator]
图片向上滚动并且有停顿的特效
[code]<table width="165" border="0" cellpadding="4" cellspacing="1" bgcolor="B6B191">
<tr>
<td bgcolor="FFFDE8" class="p12h">
<table width="140" border="0" cellspacing="0" align="center">
<tr><td>
<div id="article1" style="width:165;">
<img src="http://myarticle.enet.com.cn/images/2007/1025/1193293759309.jpg"> <BR>
<img src="http://myarticle.enet.com.cn/images/2007/1025/1193293825379.jpg"> <BR>
<img src="http://myarticle.enet.com.cn/images/2007/1025/1193293947469.jpg"> <BR>
<img src="http://myarticle.enet.com.cn/images/2007/1025/1193293979242.jpg"> <BR>
<img src="http://myarticle.enet.com.cn/images/2007/1025/1193294025878.jpg"> <BR>
<img src="http://myarticle.enet.com.cn/images/2007/1025/1193294047979.jpg"> <BR>
<img src="http://myarticle.enet.com.cn/images/2007/1025/1193293979242.jpg"> <BR>
<img src="http://myarticle.enet.com.cn/images/2007/1025/1193294109987.jpg"> <BR>
<img src="http://myarticle.enet.com.cn/images/2007/1025/1193293979242.jpg"> <BR>
<img src="http://myarticle.enet.com.cn/images/2007/1025/1193293979242.jpg"> <BR>
</div>
<div id="article2" style="position:absolute;z-index:1;visibility:hidden"></div>
</td></tr></table>
</td></tr></table>
<script>
articleHeight=300;
stopscrolla=false;
article1.scrollTop=0;
//more javascript from http://cfan.net.cn
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()",50);
}
function scrollUp1(){
if(stopscrolla==true) return;
currentTopa+=1;
if(currentTopa==68)
{
stoptimea+=1;
currentTopa-=1;
if(stoptimea==50)
{
currentTopa=0;
stoptimea=0;
}
}
else {
preTopa=article1.scrollTop;
article1.scrollTop+=1;
if(preTopa==article1.scrollTop){
article1.scrollTop=article2.offsetHeight-articleHeight;
article1.scrollTop+=1;
}
}
}
init_srolltext1();
</script>[/code]
请发表您的评论