作者 Karson

优化多选下拉列表初始化样式

@@ -153,9 +153,28 @@ select.selectpicker { @@ -153,9 +153,28 @@ select.selectpicker {
153 max-height: 31px; 153 max-height: 31px;
154 overflow: hidden; 154 overflow: hidden;
155 } 155 }
156 -select.bs-select-hidden[multiple] > option,  
157 -select.selectpicker[multiple] > option { 156 +select.bs-select-hidden[multiple],
  157 +select.selectpicker[multiple] {
158 height: 31px; 158 height: 31px;
  159 + padding: 0;
  160 + background: #f4f4f4;
  161 +}
  162 +select.bs-select-hidden[multiple] option,
  163 +select.selectpicker[multiple] option {
  164 + color: #f4f4f4;
  165 + zoom: 1;
  166 + filter: alpha(opacity=0);
  167 + -webkit-opacity: 0;
  168 + -moz-opacity: 0;
  169 + opacity: 0;
  170 +}
  171 +@media not all and (min-resolution: 0.001dpcm) {
  172 + @supports (-webkit-appearance:none) {
  173 + select.bs-select-hidden[multiple],
  174 + select.selectpicker[multiple] {
  175 + visibility: hidden;
  176 + }
  177 + }
159 } 178 }
160 .img-center { 179 .img-center {
161 margin: 0 auto; 180 margin: 0 auto;
@@ -197,8 +197,23 @@ select.bs-select-hidden, select.selectpicker { @@ -197,8 +197,23 @@ select.bs-select-hidden, select.selectpicker {
197 display: inherit !important; 197 display: inherit !important;
198 max-height: 31px; 198 max-height: 31px;
199 overflow: hidden; 199 overflow: hidden;
200 - &[multiple] > option {  
201 - height:31px; 200 +
  201 + &[multiple] {
  202 + height: 31px;
  203 + //visibility: hidden;
  204 + padding: 0;
  205 + background: #f4f4f4;
  206 +
  207 + option {
  208 + color: #f4f4f4;
  209 + .opacity(0);
  210 + }
  211 +
  212 + @media not all and (min-resolution: .001dpcm) {
  213 + @supports (-webkit-appearance:none) {
  214 + visibility: hidden;
  215 + }
  216 + }
202 } 217 }
203 } 218 }
204 219