一区二区久久-一区二区三区www-一区二区三区久久-一区二区三区久久精品-麻豆国产一区二区在线观看-麻豆国产视频

js下用層來實現select的title提示屬性

復制代碼 代碼如下:
<script>
             function opts(selectObj){
                         var optDivs=document.createElement("div");
                         var objTable=document.createElement("table");
                         var objTbody=document.createElement("tbody");
                         optDivs.style.zIndex = "100";
                         objTable.style.zIndex = "100";
                         objTable.width=selectObj.style.width;    
                         objTable.border = "0";
                         objTable.cellPadding = "0";
                         objTable.cellSpacing = "0";
                         objTable.style.paddingLeft = "2";    
                         objTable.style.fontFamily = "Verdana, Arial, Helvetica, sans-serif";

                         var e = selectObj;
                         var absTop = e.offsetTop;
                         var absLeft = e.offsetLeft;
                         var absWidth = e.offsetWidth;
                         var absHeight = e.offsetHeight;

                         while(e = e.offsetParent){
                         absTop += (e.offsetTop+0.3);
                         absLeft += e.offsetLeft;
                         }

                         with (objTable.style){
                         position = "absolute";
                         top = (absTop + absHeight) + "px";
                         left = (absLeft+1) + "px";
                         border = "1px solid black";
                         tableLayout="fixed";
                         wordBreak="break-all";
                         }

                         var options = selectObj.options;
                         var val=selectObj.value;

                            if (options.length > 0){
                                 for (var i = 0; i < options.length; i++){
                                     var newOptDiv = document.createElement("td");
                                     var objRow=document.createElement("tr");
                             newOptDiv.name=options[i].value;
                             newOptDiv.innerText=options[i].innerText;
                             newOptDiv.title=options[i].title;
                             newOptDiv.onmouseout = function() {this.className='smouseOut';val=selectObj.value};
                             newOptDiv.onmouseover = function() {this.className='smouseOver';val=this.name;};
                             newOptDiv.className="smouseOut";
                             newOptDiv.style.width=40;
                             newOptDiv.style.cursor="default";
                             newOptDiv.style.fontSize = "11px";
                             newOptDiv.style.fontFamily = "Verdana, Arial, Helvetica, sans-serif";

                             objRow.appendChild(newOptDiv);
                             objTbody.appendChild(objRow);
                             }
                            }

                    
                            objTbody.appendChild(objRow);
                            objTable.appendChild(objTbody);
                            optDivs.appendChild(objTable);
                            document.body.appendChild(optDivs);

                             var IfrRef = document.createElement("div");
                            IfrRef.style.position="absolute";
                            IfrRef.style.width = objTable.offsetWidth;
                            IfrRef.style.height = objTable.offsetHeight;
                            IfrRef.style.top = objTable.style.top;
                            IfrRef.style.left = objTable.style.left;
                            IfrRef.style.backgroundColor = document.bgColor;
                            document.body.appendChild(IfrRef);

                            objTable.focus();
                            objTable.onblur=function() {choose(selectObj,val,optDivs,IfrRef)};
         }

         function choose(objselect,val,delobj,delobj2){
             objselect.value=val;
             document.body.removeChild(delobj);
             document.body.removeChild(delobj2);
         }

         </script>

        
         <STYLE>
                    .smouseOut {
                            background: document.bgColor;
                            color: #000000;
                    }
                    .smouseOver {
                            background: rgb(0,128,128);
                            color: #FFFFFF;
                            cursor: pointer;
                    }
            </style>

        
         <select id='selId'    style='width:50px' class='black' onclick="opts(this);">
                <option value='1' title="One....">111</option>
                <option value='2' title="Two....">222</option>

            </select>

JavaScript技術js下用層來實現select的title提示屬性,轉載需保留來源!

鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。

主站蜘蛛池模板: 一级特黄毛片 | 亚洲一区二区三区在线网站 | 影音先锋中文一区亚洲 | 99在线精品免费视频九九视 | 精品国产亚一区二区三区 | 国产成人最新毛片基地 | 成人污视频在线观看 | 一级做a爰片久久毛片美女 一级做a爰片久久毛片人呢 | 亚洲国产成人在线观看 | 国产精品第100页 | 国产精品一区二区在线播放 | 在线永久免费观看黄网站 | 国产成人午夜性a一级毛片 国产成人系列 | 美女视频永久黄网站免费观看韩国 | 狠狠色噜噜狠狠狠狠奇米777 | 国产亚洲视频网站 | 国产麻豆综合视频在线观看 | 色婷婷基地 | 国产综合在线观看视频 | 好吊妞视频免费观看va | 色哟哟在线播放 | 婷婷综合社区 | 国产亚洲漂亮白嫩美女在线 | 亚洲视频a | 涩涩视频在线看 | 伊人99在线 | 国产中文字幕在线免费观看 | 五月婷婷免费视频 | 天天综合天天色 | 69精品在线观看 | 亚洲成人福利在线 | 一区二区三区四区在线不卡高清 | 国产手机在线精品 | 麻豆91av| aaaaaa精品视频在线观看 | 久久综合五月开心婷婷深深爱 | 亚洲天堂一区二区在线观看 | 亚洲人成综合 | 操吊视频| 男女朋友做爽爽爽免费视频网 | 麻豆轻量版 |