レンダリング: コードは次のとおりです: コードをコピーします コードは次のとおりです。 可以编辑的下来框实现方法--woody.wu <br>.cssINPUT <br>{ <br>height: 19PX; <br>padding: 3PX; <br>padding-left: 3px; <br>padding-right: 0px; <br>margin: 0PX; <br>border: 1PX SOLID #C0C0C0; <br>font-family: 宋体,arial; <br>font-size: 9pt; <br>} <br>.select_div_list <br>{ <br>position: absolute; <br>border: 1px solid black; <br>background-color: White; <br>overflow: hidden; <br>overflow-y: auto; <br>} <br>.select_div_list_ul <br>{ <br>margin: 0px; <br>padding: 0px; <br>list-style-type: none; <br>} <br>.select_div_list_ul li <br>{ <br>cursor: pointer; <br>padding-left: 3px; <br>font-family: 宋体,arial; <br>font-size: 9pt; *padding:0px;*height:20px;_height:14px;_margin:0px;_height:14px;*margin:0px;line-height:14px;} <br>.selectSPAN <br>{ <br>background-color: Yellow; <br>} <br> <br>var inputID = "input1"; <br>var selectID = "select1"; <br>var widt = 0; <br>var inputWi = 0; <br>var he = 0; <br>$(function() { <br>inputID = "input1"; <br>selectID = "select1"; <br>widt = 200; <br>inputWi = widt - 20; <br>he = $("#user").height() - 41; <br>var offset = $("input[id=input1]").offset(); <br>$("#" + selectID).change(function() { <br>var newvar = $("#" + selectID).find("option:selected").text(); <br>$("#" + inputID).val(newvar); <br>}).click(function() { <br>$("#select_div_on_key" + selectID).remove(); <br>}).css({ "display": "block", "width": widt + "px", "z-index": 1, "clip": "rect(0px " + widt + "px 51px 151px)" }); <br>$("#" + inputID).keyup(function() { <br>ShowSelectCombo(); <br>}).click(function() { <br>ShowSelectCombo(); <br>}).css({ "z-index": 2, "width": inputWi + "px" }); ; <br>}); <br>function ShowSelectCombo() { <br>var pob = $("#" + inputID); <br>var v = pob.val(); <br>var off = pob.offset(); <br>var wi = pob.width() + 16; <br>var tp = off.top + pob.height() - 100 + 7; <br>var lef = off.left - 200 + 2; <br>var html = "<div class='select_div_list' id='select_div_on_key" + selectID + "' style='width:" + wi + "px;top:" + tp + "px;left:" + lef + "px;'><ul class='select_div_list_ul'>"; <br>$("#" + selectID).find("option").each(function() { <br>var tk = $(this); <br>html += "<li val='" + tk.val() + "' ht='" + encodeURIComponent(tk.html()) + "'>" + tk.html().replace(v, "<span class='selectSPAN'>" + v + "</span>") + "</li>"; <br>}); <br>html += "</ul></div>"; <br>var ulDIV = $("#select_div_on_key" + selectID); <br>ulDIV.remove(); <br>$("#user").append(html); <br>var ulDIV = $("#select_div_on_key" + selectID); <br>var hei = ulDIV.find("ul").height(); <br>var newHeight = hei > he ? he : hei; <br>ulDIV.css({ height: newHeight + "px" }); <br>ulDIV.find("li").hover(function() { <br>$(this).css({ "background-color": "#316ac5" }); <br>}, function() { <br>$(this).css({ "background-color": "white" }); <br>}); <br>ulDIV.find("li").click(function() { <br>var ki = $(this); <br>var va = ki.attr("val"); <br>var htm = ki.attr("ht"); <br>htm = decodeURIComponent(htm); <br>$("#" + inputID).val(htm); <br>$("#" + selectID).val(va); <br>ulDIV.remove(); <br>}); <br>} <br> 車体および底盤修整設備 真空吸盤 氧/エチル炔焊割工具 冷鉚机 大市場撒ダン 大擦 第3 大市場 車身外形修复机(介子机) 沙皮狗 整形机 舉升机 修車躺板 空調制冷劑充注機