首頁  >  文章  >  web前端  >  js模擬select下拉式選單控制項的程式碼_javascript技巧

js模擬select下拉式選單控制項的程式碼_javascript技巧

WBOY
WBOY原創
2016-05-16 17:34:27911瀏覽
複製程式碼 程式碼如下:


 
 
 
 
 js模拟select
 
   
 
  

          

            

                

select选择


                
                

                        
  • jq的select模拟1

  •                     
  • jq的select模拟2

  •                     
  • jq的select模拟3

  •                 

            

            

                

select选择2


                
                

                        
  • jq的select模拟11

  •                     
  • jq的select模拟22

  •                     
  • jq的select模拟31

  •                 

            


        

 

  

     window.onload=function(){
     var oflink = document.getElementById('sel');     var aUl = oflink.getElementsByTagName('ul');
     var aH3= oflink.getElementsByTagName('h3');
 
         aDt[i].index = i;
         aDt[i].onclick = function(ev){
  window.event;
             var This = this;
                  aUL[i].style.display = 'none';
}
             aUl[this.index].style.display = 'block';
                aUl[This.index].style.display = '無';
             };
             ev.cancelBubble =     for(var i=0;i
         全部[i].index = i;

         (function(ul){

                  for(var i=0 ;i                 iLi[i].onmouseover = function(){
                 };
                 iLi[i]. function(){
                    this.className = '';
           iLi[i].onclick = function(ev){
                    aH3[this.parentNode.index].innerHTML = this.innerHTML;
                       this.parentNode.style.display = 'none';
                };
         };
         };
    >
         })(aUl[i]);
     }

 }
   🎜>
陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn