}
selectsearch();
}
});
// 隐藏 原始select
selectobj.each(function() {
if ($(this).attr(‘m’) == ‘search’) {
$(this).hide();
}
});
//创建 select div
function selectsearch() {
myhtml = “<div id=” + selectinput + objid + ” style=’height: 18px;color:white; background:white; font-size:12;left:” + selectleft + “;top:” + selecttop + “;’><nobr><input type=’text’ name=” + selectinputname + objid + ” id=” + selectinputname + objid + ” style=’border:1px solid #CCC;margin: 0pt 0px 0pt 0px;font-size:” + mfont + “;vertical-align:middle;’><img class=’selectimg’ id=” + imgselect + objid + ” src=’img/multiselect.gif’ title=’快速定位’ style=’vertical-align:middle;’></nobr></div>”;
if (!$(‘#’ + selectinput + objid).html()) {
obj.after(myhtml);
selectkeyup(); //添加keyup事件
}
$(‘#’ + selectinput + objid).css({
// ‘left’: selectleft,
// ‘top’: selecttop,
‘font-size’: mfont,
‘width’: inputwidth
});
$(‘#’ + selectinputname + objid).css({
‘width’: inputwidth
});
$(‘#’ + selectinputname + objid).val(objhtml);
$(‘#’ + selectinputname + objid).focus(function() {
var myid;
myid = $(this).attr(‘id’);
objid = myid.replace(“selectinputname”, “”);
obj = $(‘#’ + selectinput + objid);
});
/* $(‘#’ + imgselect + objid).click(function() {
var myid;
myid = $(this).attr(‘id’);
objid = myid.replace(“imgselect”, “”);
obj = $(‘#’ + selectinput + objid);
creatediv();
//alert(1);
});*/
$(‘#’ + selectinputname + objid).blur(function() {
var myid;
myid = $(this).attr(‘id’);
objid = myid.replace(“selectinputname”, “”);
$(‘#’ + selectinputname + objid).val($(‘#’ + objid).find(‘option:selected’).text());
$(‘#’ + imgselect + objid).attr(“src”, “img/multiselect.gif”);
//$(‘#selectcontent’).remove();
//creatediv();
//alert(obj.val());
});
$(‘#’ + selectinput + objid).show();
//$(‘#’ + selectinputname + objid).focus();
$(‘#’ + selectinput + objid).hover(
function() {
obj = $(this);
creatediv();
},
function() {
objid = $(this).attr(‘id’);
objid = objid.replace(“selectinput”, “”);
$(‘#’ + selectinputname + objid).val($(‘#’ + objid).find(‘option:selected’).text());
$(‘#’ + imgselect + objid).attr(“src”, “img/multiselect.gif”);










