function?drag(){
???var?loginState=document.getElementById('loginState'),
???????stateList=document.getElementById('loginStatePanel'),
???????lis=stateList.getElementsByTagName('li'),
???????stateTxt=document.getElementById('login2qq_state_txt'),
???????loginStateShow=document.getElementById('loginStateShow');
/*???loginState.onclick=function(e){
????????e?=?e?||?window.event;
?????if(e.stopPropagation){
??????????e.stopPropagation();
?????}else{
??????????e.cancelBubble=true;
?????}*/
????????stateList.style.display='block';
???}
???//?鼠標(biāo)滑過、離開和點擊狀態(tài)列表時
???for(var?i=0,l=lis.length;i<l;i++){
??????lis[i].onmouseover=function(){
???????this.style.background='#567';
??????}
??????lis[i].onmouseout=function(){
???????this.style.background='#FFF';
??????}
??????/*lis[i].onclick=function(e){
???????e?=?e?||?window.event;
???????if(e.stopPropagation){
??????????e.stopPropagation();
???????}else{
??????????e.cancelBubble=true;
???????}*/
???????var?id=this.id;
???????stateList.style.display='none';
????????stateTxt.innerHTML=getByClass('stateSelect_text',id)[0].innerHTML;
????????loginStateShow.className='';
????????loginStateShow.className='login-state-show?'+id;
??????}
???}
2016-05-03
算了,我知道怎么做了,是我看錯了才一直沒寫對