麻烦将该段JS实现固定在网页右上角旋转文字的代码去掉始终在右上角的效果
<p><SCRIPTlanguage="JavaScript">textstr="sdakjdwd";TColor="#000000";TFont="幼圆";textst...
<p>
<SCRIPT language="JavaScript">
textstr="sdakjdwd ";
TColor="#000000";
TFont="幼圆";
textstr=textstr.split("");
n=textstr.length;
mass=360/n;
cy=cx=sb=0;
yb=50;
xb=60;
sa=0.1;
pa=new Array();
pb=new Array();
for (i=0; i < n; i++) document.write('<div id="logo" style="position:absolute;top:0;left:0;'+'height:30;width:30;font-family:'+TFont+';text-align:center;color:'+TColor+'">'+textstr[i]+'</div>');
function sport(){
cy=document.body.scrollTop+60;
cx=document.body.scrollLeft+window.document.body.clientWidth-100;
for (i=0; i < n; i++){
logo[i].style.top =cy+yb*Math.sin(sb+i*mass*Math.PI/180);
logo[i].style.left=cx+xb*Math.cos(sb+i*mass*Math.PI/180);
pb[i]=logo[i].style.pixelTop-cy;
pa[i]=pb[i]-pb[i]*2;
if (pa[i] < 1){
pa[i]=0;
logo[i].style.visibility='hidden';
}
else logo[i].style.visibility='visible';
logo[i].style.fontSize=pa[i]/1.7;
}
sb-=sa;
setTimeout('sport()',100);
}
sport();
</SCRIPT>
</p>
如上图,右上角有旋转文字
当我向下滚动时右上角旋转文字会跟着下来,能不能将这个效果去掉 展开
<SCRIPT language="JavaScript">
textstr="sdakjdwd ";
TColor="#000000";
TFont="幼圆";
textstr=textstr.split("");
n=textstr.length;
mass=360/n;
cy=cx=sb=0;
yb=50;
xb=60;
sa=0.1;
pa=new Array();
pb=new Array();
for (i=0; i < n; i++) document.write('<div id="logo" style="position:absolute;top:0;left:0;'+'height:30;width:30;font-family:'+TFont+';text-align:center;color:'+TColor+'">'+textstr[i]+'</div>');
function sport(){
cy=document.body.scrollTop+60;
cx=document.body.scrollLeft+window.document.body.clientWidth-100;
for (i=0; i < n; i++){
logo[i].style.top =cy+yb*Math.sin(sb+i*mass*Math.PI/180);
logo[i].style.left=cx+xb*Math.cos(sb+i*mass*Math.PI/180);
pb[i]=logo[i].style.pixelTop-cy;
pa[i]=pb[i]-pb[i]*2;
if (pa[i] < 1){
pa[i]=0;
logo[i].style.visibility='hidden';
}
else logo[i].style.visibility='visible';
logo[i].style.fontSize=pa[i]/1.7;
}
sb-=sa;
setTimeout('sport()',100);
}
sport();
</SCRIPT>
</p>
如上图,右上角有旋转文字
当我向下滚动时右上角旋转文字会跟着下来,能不能将这个效果去掉 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询