tambc

          BlogJava 首頁 新隨筆 聯系 聚合 管理
            5 Posts :: 21 Stories :: 5 Comments :: 0 Trackbacks

          圖片:

          < BODY? style =font-size:12 > ?
          下拉選擇框:?

          < select? style =width:200 > ?
           ?
          < option > 經過rebuild的下拉選擇框1 </ option > ?
          ?
          < option > 經過rebuild的下拉選擇框2 </ option > ?
          ?
          < option > 經過rebuild的下拉選擇框3 </ option > ?
          ?
          < option > 經過rebuild的下拉選擇框4 </ option > ?
          ?
          < option > 經過rebuild的下拉選擇框5 </ option > ?
          </ select > ?
          < div? align =center? style ="position:?absolute;?line-height:?200px;?left:?91;?top:?39;?width:?300;?height:?202;?background-color:?#d4d0c8;?background-repeat:?repeat;?background-attachment:?scroll;?border:?1px?solid?#808080;?background-position:?0%" > 層模擬的對話框或菜單 </ div > ?
          </ BODY > ?
          < script > ?
          selRebuild()?
          function ?selRebuild() {?
            
          var ?l,i,j,w,h,ol,sel,tx,bx?
            
          if ( ! document.all)?
              
          return ?
            ol
          = document.getElementsByTagName( " select " )?
            
          for (i = 0 ;i < ol.length;i ++ ) {?
              sel
          = ol[i]?
              
          if (sel.rebuild == 1 )?
                
          continue ?
              sel.rebuild
          = 1 ?
              sel.w
          = sel.offsetWidth?
              sel.style.display
          = " none " ?
              l
          = " <input?readonly?onmouseup=this.style.backgroundPositionY=0 " ?
              l
          += " ?style=’width: " + sel.w + " ;height:21px;background:url(41.gif)?right?top?no-repeat’> " ?
              l
          += " <div?onmousedown=event.cancelBubble=true?style=position:absolute;cursor:default></div> " ?
              sel.insertAdjacentHTML(
          " afterend " ,l)?
              tx
          = sel.nextSibling?
              
          if (sel.length > 0 )?
                tx.value
          = sel.options[sel.selectedIndex].text?
              bx
          = tx.nextSibling?
              bx.sel
          = sel?
              document.body.previousSibling?
              tx.onmousedown
          = function () {?
                
          var ?tx = this ,sel = tx.previousSibling,bx = tx.nextSibling?
                
          if (window.$bxSelectOption != null )?
                  window.$bxSelectOption.innerHTML
          = "" ?
                tx.style.backgroundPositionY
          =- 17 ?
                h
          = bx.sel.options.length * 15 + 3 ?
                
          if (h <= 2 || h > 167 )?
                  h
          = 167 ?
                ?
                l
          = " <div?style=’position:absolute;left:- " + sel.w + " ;top:22;width: " + sel.w + " ;height: " + h + " ;background:white;border:1px?solid?black;overflow:auto’> " ?
                l
          += " <table?onselectstart=return(false)?cellpadding=0?cellspacing=0?style=width:100%;font-size:12> " ?
                
          for (j = 0 ;j < sel.length;j ++ ) {?
                  l
          += " <tr?height=15?onclick=this.parentNode.parentNode.parentNode.parentNode.optionClick() " ?
                  l
          += " ?onmouseover=this.parentNode.parentNode.parentNode.parentNode.optionMove(this.rowIndex)> " ?
                  l
          += " <td?valign=bottom?style=padding-left:2> " + sel.options[j].text + " </td></tr> " ?
                }
          ?
                l
          += " </table></div> " ?
                bx.innerHTML
          = l?
                window.$bxSelectOption
          = bx?
                
          if (bx.sel.length > 0 )?
                  bx.optionMove(bx.sel.selectedIndex)?
                event.cancelBubble
          = true ?
              }
          ?
              bx.optionMove
          = function (index) {?
                
          var ?bx = this ,tb?
                tb
          = bx.children[ 0 ].children[ 0 ]?
                
          if (tb.selIndex != null )?
                  tb.rows[tb.selIndex].style.cssText
          = "" ?
                tb.selIndex
          = Math.min(index,tb.rows.length - 1 )?
                tb.rows[tb.selIndex].style.cssText
          = " background:#0A246A;color:white " ?
              }
          ?
              bx.optionClick
          = function () {?
                
          var ?bx = this ,tx = bx.previousSibling,sel = tx.previousSibling,tb = bx.children[ 0 ].children[ 0 ]?
                sel.selectedIndex
          = tb.selIndex?
                tx.value
          = sel.options[sel.selectedIndex].text?
                bx.innerHTML
          = "" ?
                
          if (sel.onchange != null )?
                  sel.onchange()?
              }
          ?
            }
          ?
            document.body.attachEvent(
          " onmousedown " , function () {?
              
          if (window.$bxSelectOption != null )?
                window.$bxSelectOption.innerHTML
          = "" ?
            }
          )?
          }
          ?
          function ?selReset(sel) {?
            
          if ( ! document.all)?
              
          return ?
            
          var ?tx = sel.nextSibling?
            tx.value
          = sel.options[sel.selectedIndex].text?
          }
          ?
          </ script >
          posted on 2006-12-21 11:45 tambc 閱讀(347) 評論(0)  編輯  收藏 所屬分類: JavaScript
          主站蜘蛛池模板: 颍上县| 花莲县| 丹阳市| 闽清县| 茌平县| 嘉禾县| 大冶市| 卓资县| 繁峙县| 霍城县| 靖安县| 冕宁县| 红桥区| 西平县| 浦县| 平远县| 隆子县| 三河市| 厦门市| 通许县| 驻马店市| 赣州市| 阳谷县| 正安县| 民丰县| 澳门| 新平| 棋牌| 镇雄县| 肥城市| 比如县| 延津县| 札达县| 河北区| 古田县| 来宾市| 成都市| 吴忠市| 曲沃县| 榆社县| 响水县|