php歌词滚动,javascript之水平横向滚动歌词同步的应用_javascript技巧

bbw += this.fjh[ki];

var kt = ki-1;

var sc = ((kivar tc = tme - this.ddh[kt];

bbw -= this.fjh[kt] - tc / sc * this.fjh[kt];

if(bbw>eval("lrcbox"+(this.dlt+1)).offsetWidth)

bbw = eval("lrcbox"+(this.dlt+1)).offsetWidth;

eval("lrcbc"+(this.dlt+1)).style.width = Math.round(bbw);

}

}

lrcbox1.innerText = "www.aboutplayer.com";

}

function overbottom()

{

if(aboutplayer.currentMedia.duration>0)

{

var ii;

for(ii=lrcobj.inr.length-1; ii>0 && lrcobj.inr[ii].t[0]-ffbb>=aboutplayer.currentMedia.duration; ii--){}

bottom = ii;

}

else

setTimeout("overbottom()",10);

}

function jumpto(nline)

{

lrctop -= 20*nline;

lrcoll.style.top = lrctop;

}

function toposition(step,dur)

{

if(moveflag) return;

lrcoll.style.top = lrctop--;

if(step<20)

{

step++;

setTimeout("toposition("+step+","+dur+");",dur*50);

}

}

function highcolor(step,dur)

{

if(moveflag) return;

eval("lrcbc"+predlt).filters.alpha.opacity = 100-(step++)*10;

if(step<10)

lrc1 = setTimeout("highcolor("+step+","+dur+");",dur*100);

}

function curhighcolor(step,dur)

{

if(moveflag) return;

eval("lrcbc"+(curdlt+1)).filters.alpha.opacity = (step++)*10;

if(step<10)

lrc2 = setTimeout("curhighcolor("+step+","+dur+");",dur*100);

}

function highlight(lid)

{

lid.style.color = "#00FF00";

}

function lowcolor(lid)

{

clearTimeout(lrc1);

lid.style.width = 0;

lid.filters.alpha.opacity = 100;

}

function curlowcolor(lid)

{

lid.filters.alpha.opacity = 0;

lid.style.width = "100%";

}

function lowlight(lid)

{

lid.style.color = "#0080C0";

}

function lrcrun(m)

{

lrcobj = new lrcClass(m);

lrc0 = setInterval("try {lrcobj.run(aboutplayer.controls.currentPosition+ffbb)} catch(hh){}",10);

}

MakeMovable(lrcollbox);

function MakeMovable(element)

{

element.attachEvent("onmousedown",onmousedown);

element.attachEvent("onmouseup",onmouseup);

element.attachEvent("onmousemove",onmousemove);

flagmove = false;

var s_y, o_y;

curpot = 0;

function onmousedown()

{

if(event.button!=1 || moveflag || !movable || !type || bottom==0) {flagmove = true; return;}

clearTimeout(lrc0);

if(curdlt>0) lowcolor(eval("lrcbc"+curdlt));

lowcolor(eval("lrcbc"+(curdlt+1)));

lowlight(eval("lrcbox"+(curdlt+1)));

if(lrcoll.style.pixelTop>120-top*20) lrcoll.style.top = 120-top*20;

if(lrcoll.style.pixelTop<120-bottom*20) lrcoll.style.top = 120-bottom*20;

s_y = event.clientY;

o_y = lrcoll.style.pixelTop;

element.style.cursor = "n-resize";

element.setCapture();

moveflag = true;

}

function onmousemove()

{

if(event.button!=1 || !moveflag || flagmove) return;

var offy = event.clientY-s_y;

if(o_y+offy<=120-top*20 && o_y+offy>=120-bottom*20) lrcoll.style.top = o_y+offy;

if(o_y+offy>120-top*20) lrcoll.style.top = 120-top*20;

if(o_y+offy<120-bottom*20) lrcoll.style.top = 120-bottom*20;

var pot = Math.floor((lrcoll.style.pixelTop-120)/-20);

if(pot!=curpot)

{

lowlight(eval("lrcbox"+(curpot+1)));

curpot = pot;

highlight(eval("lrcbox"+(curpot+1)));

}

}

function onmouseup()

{

if(!moveflag || flagmove) {flagmove = false; return;}

if(aboutplayer.playState==3)

{

if(lrcoll.style.pixelTop<=120-top*20 && lrcoll.style.pixelTop>100-top*20)

lrcobj.dte = -1;

else

lrcobj.dte = lrcobj.inr[Math.floor((lrcoll.style.pixelTop-120)/-20)-1].t[0];

if(lrcobj.inr[Math.floor((lrcoll.style.pixelTop-120)/-20)].t[0]-ffbb<0)

aboutplayer.controls.currentPosition = 0;

else

aboutplayer.controls.currentPosition = lrcobj.inr[Math.floor((lrcoll.style.pixelTop-120)/-20)].t[0]-ffbb;

lrcobj.dlt = Math.floor((lrcoll.style.pixelTop-120)/-20);

lrctop = lrcoll.style.pixelTop;

}

else

{

lowlight(eval("lrcbox"+(curpot+1)));

highlight(eval("lrcbox"+(curdlt+1)));

lrcoll.style.top = o_y;

}

lrc0 = setInterval("try {lrcobj.run(aboutplayer.controls.currentPosition+ffbb)} catch(hh){}",10);

element.releaseCapture();

element.style.cursor = "hand";

moveflag = false;

}

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值