好看的下拉菜单

本文介绍了一个使用HTML、CSS和JavaScript实现的自定义下拉框组件,该组件旨在替代传统的select控件,并提供了丰富的样式定制选项。文章详细展示了如何创建这一组件,包括其结构、样式设置以及交互逻辑。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

效果如下图:

 

代码:

<HTML><HEAD><TITLE>Class_Combo</TITLE>
<META content="MSHTML 6.00.2800.1589" name=GENERATOR>
<META content="" name=Author>
<META content="" name=Keywords>
<META content="" name=Description>
<SCRIPT language=JavaScript>
<!--
<!--
/** 
**    ================================================================================================== 
**    ClassName  :CLASS_COMBO 
**    Intro      :a control to replace select control in IE
**    Example    : 
      Ver        : 0.1
    --------------------------------------------------------------------------------------------------- 
 
     <div id="demo"></div>
     <SCRIPT LANGUAGE="JavaScript">
     <!--
        var de = new CLASS_COMBO('demo',100);
   de.add(new Option("<font color='red'>Red Word</font>","a"));
     //-->
    < /SCRIPT>
 
    --------------------------------------------------------------------------------------------------- 
**    Author    :ttyp 
**    Email     :ttyp@21cn.com 
**    Date      :2007-1-23
**    ================================================================================================== 
**/
 function CLASS_COMBO(id,width){ 
  this.opended = false;
  this.selectedIndex = -1;
  this.options = new Array();
  this.value  = "";
  this.text  = "";
  this.id   = id;
  var me = this;
  var ct = null; /* table */
  var hv = null; /* hidden input */
  var pl = null; /* show planel */
  var pt = null;
  var o = document.getElementById(id);
  if(o){
   var tb = document.createElement("table");
    o.appendChild(tb);
    this.handle = tb;
  
   var tr = tb.insertRow();
   var tc = tr.insertCell();
   var th = tr.insertCell();   
    tc.style.width = (width - 14) + 'px';
    tc.style.whiteSpace = "nowrap";
    ct = tc;
    th.style.fontFamily="webdings";
    th.style.fontSize = "6pt";
    th.style.width = "14px";
    th.style.backgroundColor = "#f8f8f8";
    th.align = "center";
    th.innerText = "6";
    th.οnmοuseοver= function(){this.style.cursor='default';}
    th.onselectstart = function(){return false;}
    tb.style.borderCollapse ="collapse";
    tb.style.fontSize ="9pt";
    tb.style.tableLayout = "fixed";
    tb.border = 1;
    tb.borderColor = "#f0f0f0";
    tb.cellSpacing = 0;
    tb.cellPadding = 1;
    tb.setAttribute("accoc",id + "__combo_contain");
    tb.onclick = function(){tb.focus();me.show();}
    tb.onmouseover = function(){
     this.borderColor = "#316ac5"; /*IE*/
     this.style.border = "#316ac5 1px solid"; /* Safari, Opera and Mozilla */
    }
    tb.onmouseout = function(){
     this.borderColor = "#f0f0f0"; /*IE*/
     this.style.border = "#f0f0f0 1px solid"; /* Safari, Opera and Mozilla */   
    }
    tb.οnblur=function(){
     var active = document.activeElement;
     var stopHide = false;
     if(active!=null){     
      if(active.tagName =="TD"){
       while(active!=null&&active.tagName!="TABLE"){
        active = active.parentNode;
       }
      }
      var ac = active.getAttribute("accoc");
      if(ac!=null&&typeof(ac)!="undefined"&&ac==id + "__combo_contain"){   
       stopHide = true;
      }
     }
     if(stopHide==false){
      me.hide();
     }
    }

    pl = document.createElement("div");
    o.appendChild(pl);
    pt = document.createElement("table");
    pl.appendChild(pt);
    var w,l,t,h;
   
    var r = getAbsolutePos(me.handle);
    w = r.w;
    l = r.x;
    t = r.y+r.h;
                pl.style.position = "absolute";
                pl.style.top = t;
                pl.style.left = l;
                pl.style.width = w;
                pl.style.overflowY  = "auto";
                pl.style.overflowX = "hidden";     
                pl.style.backgroundColor = "#ffffff";
                pl.style.border  = "1px solid #f0f0f0";
    pl.style.display = "none";
    pl.style.padding = "0";
                pl.setAttribute("accoc",id + "__combo_contain"); /* for scrolling */
                pl.onblur = me.handle.onblur;
                pl.onselectstart  = function(){return false;}
                pl.onfocus = function(){ me.handle.focus();}
    pt.style.borderCollapse ="collapse";
    pt.style.fontSize ="9pt";
    pt.style.width = "100%";
    pt.border = 0;
    pt.cellSpacing = 0;
    pt.cellPadding = 1;
    hv = document.createElement("input");   /* Create hidden input for submit */
    hv.type = "hidden";
    hv.name = id + "__combo_hiden_value";   
    hv.id = id + "__combo_hiden_value";
    o.appendChild(hv);
   
  }
  this.add = function(op){
   var tr = pt.insertRow();
   var tc = tr.insertCell();
   var dv = document.createElement("div");
    tc.appendChild(dv);
    dv.style.width = "100%";
    dv.style.border = "1px solid #f0f0f0";
    dv.style.padding = "1 1 1 1";
    dv.style.cursor = "hand";
    dv.style.wordBreak = "break-all";
    dv.style.wordWrap = "break-word";
    dv.innerHTML  = op.text;
    dv.onmouseout = function(){this.style.border = "1px solid #f0f0f0";}
    dv.οnmοuseοver= function(){this.style.border = "1px solid #316ac5";}
    dv.onmousedown = function(){var nn = this;while(nn!=null&&nn.tagName!="TR"){nn = nn.parentNode;}me.setIndex(nn.rowIndex);}  /*when you use onclick event,the event while be ignored*/
   if(this.selectedIndex<0){ /*set the first option for default*/
    this.setIndex(0);
   }
   this.options[this.options.length] = op;
   /*
    * adjust panel height
    */
   if(this.options.length>10)
   {
    pl.style.height = "200px";
   }
  }
  /* OnClick Event */
  this.onclick = function(){
  }
  /* OnChange Event */
  this.onchange = function(){
  }
  this.setIndex = function(index){
   if(index>=0&&index<this.options.length){   
    var op = this.options[index];
    this.selectedIndex = index;
    this.value = hv.value;
    this.text = op.text;
    ct.innerHTML= toText(op.text);
    hv.value = op.value; /*for submit*/
    this.onchange(); /* fire event */
   }else{
    this.selectedIndex = -1;
    this.value = "";
    this.text = "";
    hv.value = "";
    ct.innerText= "";
    this.onchange(); /* fire event */
   }
  }
 
  function getAbsolutePos(el){
   var r = { x: el.offsetLeft, y: el.offsetTop,w:el.offsetWidth,h:el.offsetHeight};
   if (el.offsetParent){
    var tmp = getAbsolutePos(el.offsetParent);
     r.x += tmp.x;
     r.y += tmp.y;
   }
   return r;
  }; 
 
  function toText(txt){ /*inner function*/
   var o = document.createElement("div");
    o.innerHTML = txt;
   var s = o.innerText;
   delete o;
   o = null;
   return s;
  }
  this.getText = function(i){
   var item = -1;
   if(i==null&&typeof(i)=="undefined"){
    item = this.selectedIndex;
   }else{
    item = i;
   }
   if(this.options.length>0&&item>=0&&item<this.options.length){
    return toText(this.options[item].text);
   }else{
    return undefined;
   }
  }
  this.show=function(){
   this.opened = !this.opened;
   if(this.opened&&this.options.length>0){
    pl.style.display = "";
   }else{
    pl.style.display = "none";
   }
  }
  this.hide=function(){
   this.opened = false;
   pl.style.display = "none";
  }
  this.clear = function(){ 
   this.hide();
   this.setIndex(-1);
   this.options.length = 0;
   for(var i=pt.rows.length-1;i>=0;i--){   
    pt.deleteRow();
   }
  }
  this.removeAt = function(index){
   if(index>=0&&index<this.options.length){
    this.hide();
    this.options.splice(index,1);
    pt.deleteRow(index);
   
    if(index<=this.selectedIndex){
     if(this.options.length>0){
      if(index<this.options.length){
       this.setIndex(index);
      }else{
       this.setIndex(this.options.length-1);    
      }
     }else{
      this.setIndex(-1);
     }
    }
    if(this.options.length<10){
     pl.style.height = "";
    }
   }
  }
 }
//-->
</SCRIPT>
</HEAD>
<BODY><STRONG>Style:</STRONG>
<DIV id=demo></DIV>DSGDFGSDFG
<P></P><BR><STRONG>Font:</STRONG>
<DIV id=demo1></DIV>
<SCRIPT language=JavaScript>
 <!--
 var de = new CLASS_COMBO('demo',228);
  de.add(new Option("<font color='red'>Red Word</font>","a"));
  de.add(new Option("<strong>Strong Word</strong>","b"));
  de.add(new Option("<font size=6>Big Word</font>","c"));
  de.add(new Option("<u>Underline</u>","d"));
  de.add(new Option("<STRIKE>Strike Word</STRIKE>","e"));
  de.add(new Option("<cite>Cite Word</cite>","f"));
  de.add(new Option("<span style='background-color: black;color:white;width:100%'>Black Background</span>","g"));
  de.add(new Option("<marquee>hello</marquee>","h"));

  de.add(new Option("long word test","i"));
  de.add(new Option("<strong>Strong Word</strong>","b"));
  de.add(new Option("<font size=6>Big Word</font>","c"));
  de.add(new Option("<u>Underline</u>","d"));
  de.add(new Option("<STRIKE>Strike Word</STRIKE>","b"));
  de.add(new Option("<cite>Cite Word</cite>","c"));
  de.add(new Option("<span style='background-color: black;color:white;width:100%'>Black Background</span>","c"));
  /*
   * Set Index Demo
   */ 
  de.setIndex(1);
  /*
   * OnChange Event Demo
   */
  de.onchange = function(){
   document.title =(de.getText());
  }

 var df = new CLASS_COMBO('demo1',128);
  df.add(new Option("<font face='Arial'>Arial</font>","h"));
  df.add(new Option("<font face='Arial Black'>Arial Blak</font>","i"));
  df.add(new Option("<font face='Comic Sans MS'>Comic Sans MS</font>","j"));
  df.add(new Option("<font face='Courier New'>Courier New</font>","k"));
  df.add(new Option("<font face='Monotype Corsiva'>Monotype Corsiva</font>","l"));
  df.add(new Option("<font face='MS Sans Serif'>MS Sans Serif</font>","p"));
  df.add(new Option("<font face='Verdana'>Verdana</font>","q"));
 //-->
 </SCRIPT>

<P></P><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><INPUT οnclick=de.setIndex(3) type=button value=setIndex> <INPUT οnclick=de.removeAt(0) type=button value=remove> <INPUT οnclick=de.clear() type=button value=clear> <INPUT οnclick=alert(de.text) type=button value=text> <INPUT οnclick=alert(de.getText()) type=button value=getText> <INPUT οnclick=alert(de.value) type=button value=value> </BODY></HTML>

[removed] // ViaSelect Environment Constants var SS_ENV = new Object(); SS_ENV.IE_Version = new Number(((window.navigator.appVersion.split('; '))[1].split(' '))[1]); SS_ENV.CR = new Object(); SS_ENV.CR.ReverseBackground = '#E2519C'; SS_ENV.CR.ReverseText = 'white'; SS_ENV.CR.Border = '#D55C9A'; SS_ENV.CR.BorderActive = '#FF6CB7'; SS_ENV.DefaultHeight = 20; SS_ENV.ButtonWidth = 13; SS_ENV.OptionsDivStyle = '' + ' display:none;' + ' z-index:10;' + ' position:absolute;' + ' border:1 solid '+ SS_ENV.CR.Border+';' + ' background-color:white;' + ' scrollbar-face-color:#D4D0C8;' + ' scrollbar-shadow-color:white;' + ' scrollbar-highlight-color:#F6F5F4;' + ' scrollbar-3dlight-color:white' + ' scrollbar-darkshadow-color:#86837E;' + ' scrollbar-track-color:#F6F5F4;' + ' scrollbar-arrow-color:#86837E;'; SS_ENV.OptionNobrStyle = '' + ' font-size:12px;' + ' font-family:奔覆;'; // SaySelect Variables var SS_VAR = new Object(); SS_VAR.DivDummy = document.createElement("DIV"); SS_VAR.SelectList = new Array(); SS_VAR.bEventAttached = false; var SS_CreatedElements = new Object(); function unloadObjects() { try { if (SS_VAR && SS_VAR.SelectList) { for (key in SS_VAR.SelectList) { if (SS_VAR.SelectList[key]) { try { SS_VAR.SelectList[key].select.setAttribute('SS', 0); } catch (e) {}; delete SS_VAR.SelectList[key]; } } } } catch (e) {}; } attachEvent("onunload", unloadObjects); function SS_create (srcHTML, ListMax, bAutoDetect) { // property this.ssID = SS_VAR.SelectList.length; this.bOriginalSelect = (bAutoDetect && SS_ENV.IE_Version < 5.5); this.select = SS_createElement(srcHTML); this.selectedIndex = this.select.selectedIndex; this.options = this.select.options; this.width = parseInt(this.select.style.width); this.height = (this.select.style.height) ? parseInt(this.select.style.height) : SS_ENV.DefaultHeight; this.OptionHeight = this.height - 4; this.bListDown = (ListMax && '-'==ListMax.toString().substr(0, 1)) ? false : true; this.ListMax = (!isNaN(parseInt(ListMax))) ? Math.abs(ListMax) : 100; this.Table; this.TitleDiv; this.TitleTable; this.TitleWrapper; this.OptionsDiv; this.OptionsWrapper; this.OptionsTable; this.bFocused = false; this.bExpanded = false; this.bReverse = false; // private method this.isThisEventToBeCanceled = SS_isThisEventToBeCanceled; this.toggleTitle = SS_toggleTitle; this.syncSelectedIndex = SS_syncSelectedIndex; this.toggleOptions = SS_toggleOptions; this.turnOnOption = SS_turnOnOption; this.turnOffOption = SS_turnOffOption; this.handleMousewheel = SS_handleMousewheel; this.handleOverTitle = SS_handleOverTitle; this.handleOutTitle = SS_handleOutTitle; this.handleOverOption = SS_handleOverOption; this.createTable = SS_createTable; this.createTitleDiv = SS_createTitleDiv; this.createOptionsDiv = SS_createOptionsDiv; this.createOptionTr = SS_createOptionTr; this.adjustOptionsDiv = SS_adjustOptionsDiv; this.syncOptions = SS_syncOptions; this.pressOption = SS_pressOption; this.moveOption = SS_moveOption; this.releaseOption = SS_releaseOption; this.pressTitle = SS_pressTitle; this.releaseTitle = SS_releaseTitle; // public method this.display = SS_display; this.insertOption = SS_insertOption; this.deleteOption = SS_deleteOption; this.changeOption = SS_changeOption; // initiate this.createTable(); this.select.setAttribute('SS', this); if (!this.bOriginalSelect) this.select. SS_VAR.SelectList[this.ssID] = this; } function SS_display () { [removed]("<div id=SS_TempDiv></div>\n"); document.all.SS_TempDiv.appendChild(this.Table); document.all.SS_TempDiv.removeNode(); } function SS_write (srcHTML, ListMax, bAutoDetect) { var oSS = new SS_create(srcHTML, ListMax, bAutoDetect); oSS.display(); return oSS; } function SS_insertOption (value, innerText, idx) { var NewOption = document.createElement("OPTION"); SS_CreatedElements[SS_CreatedElements.length] = NewOption; this.options.add(NewOption, idx); NewOption.innerText = innerText; NewOption.value = value; if (!this.bOriginalSelect) this.createOptionTr(idx); this.syncOptions(); this.adjustOptionsDiv(); this.syncSelectedIndex(); } function SS_deleteOption (idx) { this.options.remove(idx); if (!this.bOriginalSelect) this.OptionsTable.deleteRow(idx); this.syncOptions(); this.adjustOptionsDiv(); this.syncSelectedIndex(); } function SS_changeOption (idx, value, innerText) { this.options[idx].value = value; this.options[idx].innerText = innerText; this.syncOptions(); this.syncSelectedIndex(); } function SS_cancelEvent (event) { event.cancelBubble = true; event.returnValue = false; } function SS_isThisEventToBeCanceled (event) { if ('object' == typeof(event)) { switch (event.type) { case 'mousedown': if (!(event.button & 1)) return true; break; case 'mouseup': if (!(event.button & 1)) return true; if (SS_ENV.IE_Version >= 5.5 && event.srcElement != this.srcElementOfLastMousedown && this.srcElementOfLastMousedown != null) { this.srcElementOfLastMousedown = null; return true; } break; case 'mouseout': if (!(SS_ENV.IE_Version < 5.5 && event.srcElement == this.srcElementOfLastMousedown)) return true; break; case 'mousemove': if (SS_ENV.IE_Version >= 5.5 && event.srcElement != this.srcElementOfLastMousedown && this.srcElementOfLastMousedown != null) return true; break; } } return false; } function SS_createElement (html) { SS_VAR.DivDummy.insertAdjacentHTML('afterBegin', html); var oEl = SS_VAR.DivDummy.children(0); while (SS_VAR.DivDummy.children.length > 0) { SS_VAR.DivDummy.removeChild(SS_VAR.DivDummy.children(0)); } return oEl; } function SS_blurExcept (except) { SS_cancelEvent(window.event); except = ('number'==typeof(except)) ? except : -1; var bHasToDetachEvent = true; for (var i=0; i < SS_VAR.SelectList.length; i++) { if (-1==except && SS_VAR.SelectList[i].bFocused && SS_VAR.SelectList[i].bExpanded) { SS_VAR.SelectList[i].toggleOptions(false, true); SS_VAR.SelectList[i].toggleTitle(true); bHasToDetachEvent = false; } else if (i!=except) { if (SS_VAR.SelectList[i].bExpanded) SS_VAR.SelectList[i].toggleOptions(false, true); if (SS_VAR.SelectList[i].bReverse) SS_VAR.SelectList[i].toggleTitle(false); SS_VAR.SelectList[i].bFocused = false; } } if (SS_VAR.bEventAttached && bHasToDetachEvent) { document.detachEvent('onmousedown', SS_blurExcept); document.detachEvent('ondblclick', SS_blurExcept); SS_VAR.bEventAttached = false; } } function SS_syncSelectedIndex () { this.selectedIndex = this.select.selectedIndex; if (this.bOriginalSelect) return; if (this.TitleTable.cells(0).childNodes(0).innerText != this.options[this.selectedIndex].innerText) this.TitleTable.cells(0).childNodes(0).innerText = this.options[this.selectedIndex].innerText; if (this.bExpanded) this.toggleOptions(false); } function SS_toggleTitle (bReverse) { this.bReverse = ('undefined'!=typeof(bReverse)) ? bReverse: (!this.bReverse); this.TitleTable.cells(0).style.backgroundColor = this.bReverse ? SS_ENV.CR.ReverseBackground : ''; this.TitleTable.cells(0).style.color = this.bReverse ? SS_ENV.CR.ReverseText : ''; } function SS_toggleOptions (bExpanded, bStrict) { if (!bStrict && !this.bFocused) { SS_blurExcept(this.ssID); } this.bExpanded = ('undefined'!=typeof(bExpanded)) ? bExpanded: (!this.bExpanded); if (this.bExpanded) { this.adjustOptionsDiv(); this.OptionsDiv.style.display = 'block'; if (!bStrict) { this.toggleTitle(false); this.handleOverOption(this.selectedIndex); } this.handleOutTitle(); } else { this.OptionsDiv.style.display = 'none'; if (!bStrict) { this.toggleTitle(true); } } if (!bStrict) { this.bFocused = true; if (!SS_VAR.bEventAttached) { document.attachEvent('onmousedown', SS_blurExcept); document.attachEvent('ondblclick', SS_blurExcept); SS_VAR.bEventAttached = true; } } } function SS_handlePropertychange () { if ('propertychange'==window.event.type && 'selectedIndex'==window.event.propertyName) { var oSS = window.event.srcElement.SS; oSS.syncSelectedIndex(); if (null != oSS.select.onchange) oSS.select.onchange(); } } function SS_handleMousewheel (event) { var idx = this.selectedIndex; if ('mousewheel'==event.type && this.bFocused && this.bReverse) { for (var i=0; i < event.wheelDelta; i += 120) idx--; for (var i=0; i > event.wheelDelta; i -= 120) idx++; } idx = Math.max(idx, 0); idx = Math.min(idx, this.options.length - 1); this.select.selectedIndex = idx; } function SS_handleOverTitle () { if (this.bExpanded) return; this.TitleTable.style.borderColor = SS_ENV.CR.BorderActive; this.TitleTable.cells(1).style.display = 'none'; this.TitleTable.cells(2).style.display = 'block'; } function SS_handleOutTitle () { this.TitleTable.style.borderColor = SS_ENV.CR.Border; this.TitleTable.cells(2).style.display = 'none'; this.TitleTable.cells(1).style.display = 'block'; } function SS_handleOverOption (idx) { for (var i=0; i < this.options.length; i++) { if (i==idx) this.turnOnOption(i); else this.turnOffOption(i); } } function SS_turnOnOption (idx) { this.OptionsTable.cells(idx).style.color = SS_ENV.CR.ReverseText; this.OptionsTable.cells(idx).style.backgroundColor = SS_ENV.CR.ReverseBackground; } function SS_turnOffOption (idx) { this.OptionsTable.cells(idx).style.color = ''; this.OptionsTable.cells(idx).style.backgroundColor = ''; } function SS_adjustOptionsDiv () { if (this.bOriginalSelect) return; this.OptionsDiv.style.width = this.width; this.OptionsDiv.style.height = Math.min(this.options.length, this.ListMax) * this.OptionHeight + 2; this.OptionsWrapper.style.height = this.options.length * this.OptionHeight; this.OptionsDiv.style.overflowY = (this.options.length > this.ListMax) ? 'scroll' : ''; var top = this.Table.offsetTop; var left = this.Table.offsetLeft; for (var El = this.Table.offsetParent; 'BODY'!=El.tagName && 'absolute'!=El.style.position && 'relative'!=El.style.position; El = El.offsetParent) { if ('TABLE' != El.tagName) { top += El.clientTop; left += El.clientLeft; } top += El.offsetTop; left += El.offsetLeft; } this.OptionsDiv.style.top = (this.bListDown) ? (top + this.height) : (top - parseInt(this.OptionsDiv.style.height)); this.OptionsDiv.style.left = left; this.TitleWrapper.style.top = 0; this.TitleWrapper.style.left = 0; } function SS_syncOptions () { if (this.bOriginalSelect) return; for (var i=0; i < this.options.length; i++) { this.OptionsTable.cells(i).setAttribute('index', i); if (this.OptionsTable.cells(i).childNodes(0).innerText != this.options[i].innerText) this.OptionsTable.cells(i).childNodes(0).innerText = this.options[i].innerText; } } function SS_pressTitle (event) { SS_cancelEvent(event); this.srcElementOfLastMousedown = event.srcElement; this.toggleOptions(); } function SS_releaseTitle (event) { SS_cancelEvent(event); if (this.isThisEventToBeCanceled(event)) return; this.srcElementOfLastMousedown = null; } function SS_pressOption (event) { SS_cancelEvent(event); this.srcElementOfLastMousedown = event.srcElement; } function SS_moveOption (event) { SS_cancelEvent(event); if (this.isThisEventToBeCanceled(event)) return; if (!(event.offsetX >= 0 && event.offsetX <= this.OptionsTable.offsetWidth)) return; this.handleOverOption(Math.floor(event.offsetY / this.OptionHeight)); } function SS_releaseOption (event) { SS_cancelEvent(event); if (this.isThisEventToBeCanceled(event)) return; this.srcElementOfLastMousedown = null; if (event.offsetX >= 0 && event.offsetX <= this.OptionsTable.offsetWidth) { this.toggleOptions(false); this.select.selectedIndex = Math.floor(event.offsetY / this.OptionHeight); } } function SS_createTable () { this.Table = SS_createElement("" + "<table border=0 cellpadding=0 cellspacing=0 cursor:default'>" + "<tr><td></td></tr>" + "</table>" ); if (!isNaN(this.width)) this.Table.style.width = this.width; this.Table.style.height = this.height; if (!this.bOriginalSelect) { this.createTitleDiv(); this.createOptionsDiv(); this.Table.cells(0).appendChild(this.TitleDiv); this.Table.cells(0).appendChild(this.OptionsDiv); } else { this.Table.cells(0).appendChild(this.select); } } function SS_createTitleDiv () { this.TitleDiv = SS_createElement("" + "<div top:0; left:0;'>" + " <table border=0 cellpadding=0 cellspacing=1" + " height="+this.height + " bgcolor=white" + " border:1 solid "+SS_ENV.CR.Border+";'" + " + " >" + " <tr>" + " <td><nobr + " <td width="+SS_ENV.ButtonWidth+" align=center + " <td width="+SS_ENV.ButtonWidth+" align=center + " <td ></td>" + " </tr>" + " </table>" + "</div>" ); this.TitleTable = this.TitleDiv.childNodes(0); this.TitleTable.cells(0).childNodes(0).innerText = this.options[this.selectedIndex].innerText; this.TitleTable.cells(1)[removed] = "<img src='btn_down.gif'>"; this.TitleTable.cells(2)[removed] = "<img src='btn_down_s.gif'>"; this.TitleTable.cells(3).appendChild(this.select); this.TitleWrapper = document.createElement("" + "<img SS_VAR.SelectList["+this.ssID+"].releaseTitle(window.event);' ); SS_CreatedElements[SS_CreatedElements.length] = this.TitleWrapper; this.TitleDiv.appendChild(this.TitleWrapper); } function SS_createOptionsDiv () { this.OptionsDiv = SS_createElement("" + "<div + " + " + ">" + " <table border=0 cellpadding=0 cellspacing=0 width=100% + " </table>" + "</div>" ); this.OptionsTable = this.OptionsDiv.childNodes(0); for (var i=0; i < this.options.length; i++) { this.createOptionTr(i); } this.syncOptions(); this.OptionsWrapper = document.createElement("" + "<img ); SS_CreatedElements[SS_CreatedElements.length] = this.OptionsWrapper; this.OptionsDiv.appendChild(this.OptionsWrapper); } function SS_createOptionTr (idx) { idx = ('undefined'!=typeof(idx)) ? idx : this.options.length - 1; var OptionTr = this.OptionsTable.insertRow(-1); var OptionTd = document.createElement("<td height="+this.OptionHeight+"></td>"); SS_CreatedElements[SS_CreatedElements.length] = this.OptionsTd; OptionTd.appendChild(document.createElement("<nobr OptionTr.appendChild(OptionTd); } [removed] </head> <body>[removed]SS_write("<select name=star>\n" +" <option value=\"\" selected>不限</option>\n" +"<option value=\"水瓶座\">水瓶座</option>" +"<option value=\"双鱼座\">双鱼座</option>" +"<option value=\"白羊座\">白羊座</option>" +"<option value=\"金牛座\">金牛座</option>" +"<option value=\"双子座\">双子座</option>" +"<option value=\"巨蟹座\">巨蟹座</option>" +"<option value=\"狮子座\">狮子座</option>" +"<option value=\"处女座\">处女座</option>" +"<option value=\"天秤座\">天秤座</option>" +"<option value=\"天蝎座\">天蝎座</option>" +"<option value=\"射手座\">射手座</option>" +"<option value=\"摩羯座\">摩羯座</option>" +"</select>\n"); [removed] <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td>[removed]SS_write("<select name='province' >\n" +"<option value=\"\" selected>都行</option>\n" +"<option value=\"北京\">北京</option>" +"<option value=\"上海\">上海</option>" +"<option value=\"天津\">天津</option>" +"<option value=\"重庆\">重庆</option>" +"<option value=\"安徽\">安徽</option>" +"<option value=\"福建\">福建</option>" +"<option value=\"甘肃\">甘肃</option>" +"<option value=\"广东\">广东</option>" +"<option value=\"广西\">广西</option>" +"<option value=\"贵州\">贵州</option>" +"<option value=\"海南\">海南</option>" +"<option value=\"河北\">河北</option>" +"<option value=\"黑龙江\">黑龙江</option>" +"<option value=\"河南\">河南</option>" +"<option value=\"湖北\">湖北</option>" +"<option value=\"湖南\">湖南</option>" +"<option value=\"内蒙古\">内蒙古</option>" +"<option value=\"江苏\">江苏</option>" +"<option value=\"江西\">江西</option>" +"<option value=\"吉林\">吉林</option>" +"<option value=\"辽宁\">辽宁</option>" +"<option value=\"宁夏\">宁夏</option>" +"<option value=\"青海\">青海</option>" +"<option value=\"山西\">山西</option>" +"<option value=\"陕西\">陕西</option>" +"<option value=\"山东\">山东</option>" +"<option value=\"四川\">四川</option>" +"<option value=\"江西\">江西</option>" +"<option value=\"西藏\">西藏</option>" +"<option value=\"新疆\">新疆</option>" +"<option value=\"云南\">云南</option>" +"<option value=\"浙江\">浙江</option>" +"<option value=\"其它\">其它</option>" +"</select>\n",8); [removed]</td> </tr> </table> <br>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值