}
.select-style select { display: none; }
.select-style {
position: relative;
display: inline-block;
font-family: Microsoft YaHei;
color: #666;
font-size: 14px;
text-align: left;
vertical-align: middle;
z-index: 50;
}
.select-style.focus { z-index: 51; }
.select-style .slt-wrap {
display: inline-block;
width: 200px;
border: solid 1px #d6d6d6;
vertical-align: middle;
}
.select-style.focus .slt-wrap { border: solid 1px #53a8df; }
.select-style .slt-title {
position: relative;
display: block;
padding: 0 36px 0 5px;
line-height: 30px;
height: 30px;
text-decoration: none;
background-color: #fff;
word-break: break-all;
color: #666;
overflow: hidden;
}
.select-style .slt-title .slt-text {
display: inline-block;
height: 30px;
*cursor: pointer;
}
.select-style .slt-title i {
position: absolute;
right: 0;
top: 0;
display: inline-block;
width: 30px;
height: 30px;
background: url(../images/ico-select.png) 0 0 no-repeat;
*cursor: pointer;
}
.select-style.focus .slt-title i { background-position: 0 -30px; }
.select-style.disabled .slt-title i {
background-position: 0 -60px;
*cursor: default;
}
.select-style .opn-box {
display: none;
position: absolute;
left: 0;
top: 31px;
width: 100%;
}
.select-style.up .opn-box {
top: auto;
bottom: 31px;
}
.select-style .opn-box .opn-list {
position: relative;
_width: 100%;
max-height: 130px;
border: 1px solid #d6d6d6;
background: #fff;
overflow-y: auto;
overflow-x: hidden;
}
.select-style.focus .opn-box .opn-list { border-color: #53a8df; }
.select-style .opn-box .opn-list li {
display: block;
_width: 100%;
padding-left: 5px;
line-height: 26px;
height: 26px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
cursor: pointer;
}
.select-style .opn-box .opn-list .selected { background: #d4edfe; }
.select-style .opn-box .opn-list li:hover {
color: #fff;
background: #65abda;
}
.select-style .opn-box .opn-list li.disabled {
color: #cacaca;
background: #f0f0f0;
cursor: default;
}
.select-style.disabled .slt-wrap { border: 1px solid #d6d6d6; }
.select-style.disabled .slt-title {
color: #cacaca;
background-color: #f0f0f0;
cursor: default;
}
.select-style.disabled .slt-title .slt-text { *cursor: default; }
/* 下拉框样式 结束 */
Jquery代码如下:
/**
* Name : 美化下拉框
**/
(function(jQuery){
$.fn.simSelect = function (o) {
o = $.extend({ //设置默认参数
maxNum: 5, //最大显示5个
width: 200, //默认宽200px。为避免过多的设置宽度,尽量依照项目中最常见的宽度设定css样式。










