友情链接应用特效
作者:cmscn 日期:2005-09-24
图片滚动到一定位置后停顿一会儿,然后再向上滚动,循环不间断。
效果演示地址:(见友情链接)
http://www.ytsb.net
代码:
<div id="icefable1">
<!--插入你的图片链接-->
<script>marqueesHeight=115;
stopscroll=false;
with(icefable1){
style.width=640;
style.height=marqueesHeight;
style.overflowX="visible";
style.overflowY="hidden";
noWrap=true;
onmouseover=new Function("stopscroll=true");
onmouseout=new Function("stopscroll=false");
}
preTop=0; currentTop=115; stoptime=0;
icefable1.innerHTML+=icefable1.innerHTML;
function init_srolltext(){
icefable1.scrollTop=0;
setInterval("scrollUp()",20);
}init_srolltext();
function scrollUp(){
if(stopscroll==true) return;
currentTop+=1;
if(currentTop==116)
{
stoptime+=1;
currentTop-=1;
if(stoptime==114)
{
currentTop=0;
stoptime=0;
}
}
else {
preTop=icefable1.scrollTop;
icefable1.scrollTop+=1;
if(preTop==icefable1.scrollTop){
icefable1.scrollTop=115;
icefable1.scrollTop+=1;
}
}
}
</script>
</div>
==================================================================
下面是我已经调试好的友情链接,将原{$ShowFriendSite(1,21,7,2)}代码,用下面的代码替换即可:
<!--友情链接滚动代码开始-->
<div id="icefable2">
{$ShowFriendSite(1,21,7,2)}
<script>marqueesHeight=41;
stopscroll=false;
with(icefable2){
style.width=750;
style.height=marqueesHeight;
style.overflowX="visible";
style.overflowY="hidden";
noWrap=true;
onmouseover=new Function("stopscroll=true");
onmouseout=new Function("stopscroll=false");
}
preTop=0; currentTop=41; stoptime=0;
icefable2.innerHTML+=icefable2.innerHTML;
function init_srolltext(){
icefable2.scrollTop=0;
setInterval("scrollUp()",50);
}init_srolltext();
function scrollUp(){
if(stopscroll==true) return;
currentTop+=1;
if(currentTop==42)
{
stoptime+=1;
currentTop-=1;
if(stoptime==40)
{
currentTop=0;
stoptime=0;
}
}
else {
preTop=icefable2.scrollTop;
icefable2.scrollTop+=1;
if(preTop==icefable2.scrollTop){
icefable2.scrollTop=41;
icefable2.scrollTop+=1;
}
}
}
</script>
</div>
<!--友情链接滚动代码结束-->
评论: 6 | 引用: 0 | 查看次数: 940
发表评论