📄 speceff.js
字号:
var charnum=8;
var colnum=8;
var interval=50;
var charinitpos=475;
var circlex=400;
var circley=160;
var pi=3.141592653589;
var moveframe=1000*2/interval;
var widenframe=1000*1/interval;
var alphaframe=1000*2/interval;
var movespeed=new Array(-5.875,-4.375,-2.875,-1.375,0.125,1.625,3.125,4.625);
var spinangle=new Array(0,45,90,135,180,225,270,315);
var colwidth=new Array(137,107,135,122,130,106,93,124);
var captext=new Array("我的购物车","会员认证","购物信息","送货信息","支付信息","最后确认","支付提示","购物完成");
var widenspeed=2.5;
var alphaspeed=1.25;
var spinspeed=1;
var radius=0;
var radiusspeed=2.9;
var charid='char';
var imgid='img';
var boxid='col';
var colimgid='colimg';
var currframe=0;
var moveflag=true;
var effstep=0;
var radiusbreath=0;
var breathdirection=1;
var breathspeed=1;
var breathend=14;
var contentid="content";
var frameid="colcontent";
var capbarid="capbar";
var scrollspeed=0;
function keycircle() {
if(currframe<moveframe) {
movechar();
currframe++;
} // move chars
else if(currframe>=moveframe&&currframe<moveframe+widenframe) {
if (currframe==moveframe) {
effstep=0;
loadimgs();
}
widenchar();
currframe++;
} // widen chars
else if(currframe>=moveframe+widenframe&&currframe<moveframe+widenframe+alphaframe) {
if (currframe==moveframe+widenframe) effstep=0;
alphaboxs();
currframe++;
} // alpha boxs
else {
effstep=-1;
interval=100;
}
if(scrollspeed!=0) document.frames[frameid].window.scrollBy(0,scrollspeed);
if(currframe>=moveframe+widenframe&&moveflag) moveboxs(); // move boxss
setTimeout("keycircle()",interval);
}
function movechar() {
for(var i=0;i<charnum;i++)
document.all[charid+i].style.left=charinitpos+effstep*movespeed[i];
effstep++;
}
function loadimgs() {
for(var i=0;i<charnum;i++) {
document.all[imgid+i].src="images/img"+i+".gif";
document.all[imgid+i].style.width=0;
}
}
function widenchar() {
for(var i=0;i<charnum;i++)
document.all[imgid+i].style.width=effstep*widenspeed;
effstep++;
}
function alphaboxs() {
for(var i=0;i<colnum;i++)
document.all[boxid+i].filters.alpha.opacity=effstep*alphaspeed;
effstep++;
}
function moveboxs() {
if(effstep!=-1) radius+=radiusspeed;
else {
if(radiusbreath==0) breathdirection=1;
else if(radiusbreath==breathend) breathdirection=0;
if(breathdirection==1) radiusbreath+=breathspeed;
else radiusbreath-=breathspeed;
}
for(var i=0;i<colnum;i++) {
document.all[boxid+i].style.left=circlex+(radius+radiusbreath)*Math.cos(spinangle[i]/180*3.14);
document.all[boxid+i].style.top=circley+(radius+radiusbreath)*Math.sin(spinangle[i]/180*3.14);
spinangle[i]+=spinspeed;
}
}
function boxonmouseover(theObj) {
if(effstep!=-1) return;
moveflag=false;
theObj.style.width=colwidth[theObj.sn];
theObj.style.left=parseInt(theObj.style.left)-1;
theObj.style.top=parseInt(theObj.style.top)-1;
document.all[theObj.id+'img'].style.width=colwidth[theObj.sn];
document.all[theObj.id+'img'].src="images/"+theObj.id+"img.gif";
theObj.filters.alpha.opacity=100;
}
function boxonmouseout(theObj) {
if(effstep!=-1) return;
moveflag=true;
theObj.style.width=50;
theObj.style.left=parseInt(theObj.style.left)+1;
theObj.style.top=parseInt(theObj.style.top)+1;
document.all[theObj.id+'img'].style.width=50;
document.all[theObj.id+'img'].src="images/box.gif";
theObj.filters.alpha.opacity=50;
}
function closebtnonclick() {
document.all[contentid].style.visibility="hidden";
}
function scrbtnonmouseover(scrspeed) {
scrollspeed=scrspeed;
}
function scrbtnonmouseout(scrspeed) {
scrollspeed=scrspeed;
}
function scrbtnonmousedown(scrspeed) {
scrollspeed=scrspeed;
}
function scrbtnonmouseup(scrspeed) {
scrollspeed=scrspeed;
}
function colbtnclick(theObj) {
document.all[contentid].style.visibility="visible";
document.all[capbarid].innerHTML='<div align="center">'+captext[theObj.sn]+'</div>';
document.all[frameid].src=theObj.id+'.htm';
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -