function setcookie(name,value){
var Days = 30;
var exp = new Date();
exp.setTime(exp.getTime() + Days*24*60*60*1000);
document.cookie = name + "="+ escape(value) +";expires="+ exp.toGMTString();
}
function getcookie(name){
var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
if(arr != null) return unescape(arr[2]); return null;
}
setcookie("box",getcookie("box"));
function addbox(name){
var a1=name+"|*|";
var box=getcookie("box");
box=box.replace(a1,"");
var value=a1+box;
setcookie("box",value);
listbox();
}
function delbox(name){
var del=name+"|*|";
var s=getcookie("box");
s = s.replace(del, "");
setcookie("box",s);
listbox();
}
function listbox(){
var tmp="";
var s2=getcookie("box");
var s3=s2.split("|*|");
var s4=s3.length-1;
if(s4>8) $("boxlist").style.height="139px";
for(var i=0;i<s4;i++){
tmp+="<div id=\"box\"><div id=\"del\" style=\"float: right;\"><span onclick=javascript:delbox('"+s3[i]+"')>删除</span></div><div id=\"boxtitle\"><a href=javascript:getname('"+s3[i]+"')>"+s3[i]+"</a></div></div>";
}
$("boxlist").innerHTML=tmp;
}
function GetEBID(id){return document.getElementById(id);}
function To(t){
if(rorw=="") return;
if(rorw=="rmp" && RPlayer.GetPlayState()==3) RPlayer.SetPosition(t*1000);
if(rorw=="wmp" && MPlayer.playState==3) MPlayer.controls.CurrentPosition=t;
}
function lrcrun(){
var rtl="|"+tl;
if((rtl.indexOf("|"+Cs+"|")) != -1){
GetEBID("LrcDiv").scrollTop=GetEBID("LrcDiv").offsetTop-parseInt(GetEBID("LrcDiv").offsetHeight/2)+GetEBID("T_"+Cs).offsetTop+10;
GetEBID("T_"+St).className="";
GetEBID("T_"+Cs).className="b";
St=Cs;
}
}
function ldL(){
if(rorw=="rmp" && RPlayer.GetPlayState()==3) {Cs=Math.floor(RPlayer.GetPosition()/1000); lrcrun();}
if(rorw=="wmp" && MPlayer.playState==3) {Cs=Math.floor(MPlayer.controls.CurrentPosition); lrcrun();}
lrcT=setTimeout("ldL()", 10);
}
Baidu Musicbox 用到的ajax代码(2)
内容版权声明:除非注明,否则皆为本站原创文章。