首页 > 其他 > 详细

select option居中显示

时间:2016-01-22 10:27:44      阅读:118      评论:0      收藏:0      [点我收藏+]

<style>
.ch-select{ padding:0px;}
.ch-select input[type=text]{ width:100%; position:relative; color:#999; font-size:12px;}
.ch-select label{ position:absolute; right:5px; top:13px;}
.ch-select select{ opacity:0; position:absolute; top:0px; left:0px; width:100%; height:40px; line-height:40px; border:0px; color:#999; padding-left:15px; font-size:12px;}
</style>

<div class="select ch-select" style="width:200px; float:left; border:0px; border-left:1px #EDEDED solid; background:none; position:relative;">
  <input class="ch-input se1" type="text" value="请选择省"/>
  <label style=" background:url(images/h_city1.gif) 95% center no-repeat; width:13px; height:13px; display:inline-block;"></label>
  <select id="se1" onchange="gradeChange(this)">
    <option>江1辅导班苏</option>
    <option>江2苏</option>
    <option>江3苏</option>
  </select>
</div>

<script>
function gradeChange(aa) {
var id = $(aa).attr("id");
var selectIndex = document.getElementById(id).selectedIndex;
var value1 = document.getElementById(id).options[selectIndex].text;
var name="."+id;
$(name).attr("value",value1);
}
</script>

select option居中显示

原文:http://www.cnblogs.com/ch-zaizai/p/5150227.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!