һ
 ע

QQ¼

ֻһٿʼ

ƼĶ

+

[CSS] DivCSSʵ̳̣Selectʽ䰸

[]
1235413 happy175 2010-6-2 09:44:23
| ʾȫ¥
1F

ϵ½עᣬύѣø๦ܣϴزIJޣ

Ҫ ¼ ſػ鿴ûʺţע  

x
DivCSSбһֱCSSerͷ۵⣬رSelectʽͷʹչʾʵϣԴҵѧϰ
Чͼʾ
QQͼδ.jpg

ʾhttp://www.websjy.com/club/websjy_index/select/


أ select.rar (11.1 KB, ش: 21483)
Դ΢http://weibo.com/techued Դ΢Źںţweb-tech
ʹõ ٱ ظ
2018-5-6 19:01:43
| ʾȫ¥
Ƽ
KA72ȫСܼСɻ1ԲӲҲ࣬ȸСȫKA72оƬڰоƬʷǿܵоƬ֤¼¼Ȳ1600صȫiPhone8ͷ8оиȶͷýOV9715ͼйоƬ170ȿȫǣKA72Dzϧɱȫ¼HDR+WDRӲһǿ⡢⡢졢졢ȲͬԶУȡɼǿ18ŽҹӵƲ첻죬֤һƬκι߿ӷΧߴ100ף¼¼ƲơҹӲ죬θ棬͵豸ǿŻκΰװθݵܼ
ѡKA72ɣ·ӡ¡¹񡢴ϴּ䡢ӡſ컨塢ơȵȣװλֻ벻ûKA72ôأ72Сʱӳ籦Դ߳¼KA72TurboһǽWIFIģ飬WIFIԶǿȶ硢ߡ貼ߣƻֻ׿ֻֻ뿴Ϳܼؾ͸ô򵥣ҪĻУ
ڻ껪ϣβһܻϣ˳졢ŮѱѡķŰͯԱ͵ֿʧԡ̱͵...ԭ࣬KA72ֵӵУ⣬﷢ʲôҪĻ棬ֻ뿴ͿԶ̼زܾƣKA72йóֻͿʵʱطšءɾ˽Ļ棬ؾأɾɾؾ͸ܡ
KA721600ء170ȴǡ18ŽҹӲ⡢HDR+WDR+WiFiܡ8ĴȫHEVC뼼׷Dz۸սֻƴƷʣ
QQ851138899    ߣ13530047234    www.25xc.net
Դ΢http://weibo.com/techued Դ΢Źںţweb-tech
ʹõ ٱ ظ ֧
fhuj3d96 2017-2-13 18:41:36
| ʾȫ¥
Ƽ
Ŷллṩ
װ             http://www.wmtdl.com/
             http://www.wmtdl.com/
װ             http://www.wmtdl.com/
װι˾             http://www.wmtdl.com/
װ             http://www.wmtdl.com/
KTVװ             http://www.wmtdl.com/
Դ΢http://weibo.com/techued Դ΢Źںţweb-tech
ʹõ ٱ ظ ֧
fhuj3d96 2016-12-5 05:23:05
| ʾȫ¥
Ƽ
Ǻǣ
ϲױѵѧУ http://www.xszsz.com/
õĻױѧУ http://www.xszsz.com/
ϲױ仯ױѧУ http://www.xszsz.com/
ϲƸױѧͽ http://www.xszsz.com/
ϲױ仯ױѧУ http://www.xszsz.com/
ϲױƷ http://www.xszsz.com/
ϲƸױѧͽ http://www.xszsz.com/
Դ΢http://weibo.com/techued Դ΢Źںţweb-tech
ʹõ ٱ ظ ֧
 ¥| happy175 2010-6-2 11:09:09
| ʾȫ¥
5F
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>Selectʽ䰸˵</title>
  6. <style type="text/css">
  7. body{margin:20px auto;font-family:Arial, Helvetica, sans-serif;font-size:12px;width:950px;height:400px;border:solid 1px #aaa; position:relative;padding:10px;}
  8. ul{margin:0;padding:0;list-style:none;}
  9. .dropDownList{position:absolute;left:100px;top:100px;}
  10. /* .dropDownList div.dropdown select{display:none;}*/
  11. .dropDownList div.dropdown{float:left;margin-right:120px;width:146px;}
  12. .dropDownList span{display:block;width:146px;height:26px;background:url(http://3.bp.blogspot.com/_bdBPvgEipxw/SRMUkLCdX0I/AAAAAAAAAP8/HgDXLapwpAw/s320/select.gif) left top no-repeat;line-height:26px;text-indent:12px;border:solid 1px #83BBD9;cursor:default;}
  13. .dropDownList span.over{background-position:left bottom;border-color:#B4C91A;}
  14. .dropDownList ul{background:#eee;width:200px;display:none;}
  15.   .dropDownList ul li{height:20px;width:100%;padding:3px 0;text-indent:12px;cursor:default;}
  16.   .dropDownList ul li.over{background:#ccc;}
  17. .dropDownList ul.show{display:block;}
  18. </style>
  19. </head>
  20. <body>
  21. <h1>JavaScriptģ˵IJִ٣Ľ</h1>
  22. <form action="#" method="get">
  23. <div class="dropDownList">
  24. <div id="dropDownList1" class="dropdown">
  25.   <select name="birthday">
  26.    <option>ѡ</option>
  27.    <option>1988</option>
  28.    <option>1989</option>
  29.   </select>
  30.   <span>ѡ</span>
  31.   <ul></ul>
  32. </div>
  33. <div id="dropDownList2" class="dropdown">
  34.   <select name="sex">
  35.    <option>Ա</option>
  36.    <option></option>
  37.    <option>Ů</option>
  38.   </select>
  39.   <span>ѡԱ</span>
  40.   <ul></ul>
  41. </div>
  42. <div id="dropDownList3" class="dropdown">
  43.   <select name="student">
  44.    <option>׶</option>
  45.    <option>Сѧ</option>
  46.    <option></option>
  47.   </select>
  48.   <span>ѡѧ</span>
  49.   <ul></ul>
  50. </div>
  51. </div>
  52. </form>
  53. </body>
  54. </html>
  55. <script type="text/javascript">
  56. // JavaScript Document
  57. var ____configArray;
  58. function __initDropDownList(configArray){
  59. //ȡSelect˵
  60. ____configArray=configArray;
  61. var existArray=configArray.split("|");
  62. for(var i=0;i<existArray.length;i++){
  63.   if(existArray[i].length<1){return;}
  64.   //ݲֱȡdivֱ¼
  65.   var parentContainer=document.getElementById(existArray[i]);
  66.   if(!parentContainer){return;}
  67.   //ȡselectһȡеoption
  68.   var selectObj=parentContainer.getElementsByTagName("select");
  69.   if(selectObj.length<1){return;}
  70.   var optionArray=selectObj[0].getElementsByTagName("option");
  71.   //ȡoptionֱӵli
  72.   var optionLength=optionArray.length;
  73.   for(var j=0;j<optionLength;j++){
  74.    //ȡulԱܹĿ
  75.    var ulObj=parentContainer.getElementsByTagName("ul");
  76.    if(ulObj.length<1){return;}
  77.    //ȡspanԱʾǰѡĿ
  78.    var spanObj=parentContainer.getElementsByTagName("span");
  79.    if(spanObj.length<1){return;}
  80.    var liObj=document.createElement("li");
  81.    var textNode=document.createTextNode(optionArray[j].firstChild.nodeValue)
  82.    liObj.appendChild(textNode);
  83.    liObj.setAttribute("currentIndex",j);
  84.    //ÿliObj¼
  85.    liObj.onclick=function(){
  86.     selectCurrentItem(this.parentNode,this);
  87.    }
  88.    liObj.onmouseover=function(){this.className="over";}
  89.    liObj.onmouseout=function(){this.className="";}
  90.    ulObj[0].appendChild(liObj);
  91.    spanObj[0].onclick=function(event){
  92.     //ǰʾģأ֮Ȼ
  93.     showHiddenUl(this);
  94.    }
  95.    spanObj[0].onmouseover=function(){this.className='over';}
  96.    spanObj[0].onmouseout=function(){this.className="";};
  97.    ulObj[0].onclick=function(){this.className="";}
  98.   }
  99.   parentContainer.onclick=function(event){
  100.    if(!event){event=window.event;}
  101.     //ֹ¼ð
  102.     event.cancelBubble=true;
  103.     var eventUlObj=this.getElementsByTagName("ul")[0];
  104.     bodyClickHiddenUl(eventUlObj);
  105.   }
  106. }
  107. }
  108. function selectCurrentItem(ulObj,currentObj){
  109. var parentObj=ulObj.parentNode;
  110. var spanObj=parentObj.getElementsByTagName("span")[0];
  111. spanObj.firstChild.nodeValue=currentObj.firstChild.nodeValue;
  112. var selectObj=parentObj.getElementsByTagName("select")[0];
  113. selectObj.selectedIndex=parseInt(currentObj.getAttribute("currentIndex"));
  114. }
  115. function showHiddenUl(currentObj){
  116. var parentNode=currentObj.parentNode;
  117. var ulObj=parentNode.getElementsByTagName("ul")[0];
  118. if(ulObj.className==""){
  119.   ulObj.className="show";
  120. }else{
  121.   ulObj.className="";
  122. }
  123. }
  124. //body򣨷ǡ˵ز˵
  125. function addBodyClick(func) {
  126. var bodyObj=document.getElementsByTagName("body")[0];
  127. var oldBodyClick = bodyObj.onclick;
  128.   if (typeof bodyObj.onclick != 'function') {
  129.    bodyObj.onclick = func;
  130.   } else {
  131.    bodyObj.onclick = function() {
  132.    oldBodyClick();
  133.    func();
  134.   }
  135. }
  136. }
  137. //еUL
  138. function bodyClickHiddenUl(eventUlObj){
  139. var existArray=____configArray.split("|");
  140. for(var i=0;i<existArray.length;i++){
  141.   if(existArray[i].length<1){return;}
  142.   //ѰUL
  143.   var parentContainer=document.getElementById(existArray[i]);
  144.   if(!parentContainer){return;}
  145.   var ulObj=parentContainer.getElementsByTagName("ul");
  146.   if(eventUlObj!=ulObj[0]){
  147.    ulObj[0].className="";
  148.   }
  149. }
  150. }
  151. var __dropDownList="dropDownList1|dropDownList2|dropDownList3";
  152. __initDropDownList(__dropDownList);
  153. //ȷbodyʱ Ҳز˵
  154. addBodyClick(bodyClickHiddenUl);
  155. </script>
ƴ
Դ΢http://weibo.com/techued Դ΢Źںţweb-tech
ʹõ ٱ ظ ֧
test 2011-3-6 14:34:08
| ʾȫ¥
6F
ݲʵ!
Դ΢http://weibo.com/techued Դ΢Źںţweb-tech
ʹõ ٱ ظ ֧
ˮ 2011-7-29 22:43:58
| ʾȫ¥
7F
ʾ: Ա
Դ΢http://weibo.com/techued Դ΢Źںţweb-tech
ʹõ ٱ ظ ֧
websjy 2013-4-2 11:37:43
| ʾȫ¥
8F
ЧǺʵõ
Դ΢http://weibo.com/techued Դ΢Źںţweb-tech
ʹõ ٱ ظ ֧
2014-3-26 17:36:05
| ʾȫ¥
9F
Ҫ֧£~~
Դ΢http://weibo.com/techued Դ΢Źںţweb-tech
ʹõ ٱ ظ ֧
2014-4-6 02:38:11
| ʾȫ¥
10F
̸֮лл¥ˣŬ
Դ΢http://weibo.com/techued Դ΢Źںţweb-tech
ʹõ ٱ ظ ֧
fhuj3d96 2016-12-5 04:34:37
| ʾȫ¥
11F
лл෢
Դ΢http://weibo.com/techued Դ΢Źںţweb-tech
ʹõ ٱ ظ ֧
fhuj3d96 2016-12-24 19:13:32
| ʾȫ¥
12F
!!!
Դ΢http://weibo.com/techued Դ΢Źںţweb-tech
ʹõ ٱ ظ ֧
12һҳ
б

ֹ

²

̳¡ͼƬѷϴվԭתԻ,µİȨԭ
վַİȨ֪ͨǵĹԱ,Ա(Email:admin@websjy.com)ʱȡȨɾ
ܾκκʽڱ̳л񹲺͹ִ!

QQ| 42011102000510|Archiver|ֻ|Դ ( ICP14013341-1

GMT+8, 2018-8-15 05:47

Powered by Discuz! X3.2

ԴԴվ  ԴAPPӦ֮

ٻظ ض б