• select option居中显示


    <style>
    .ch-select{ padding:0px;}
    .ch-select input[type=text]{ 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; 100%; height:40px; line-height:40px; border:0px; color:#999; padding-left:15px; font-size:12px;}
    </style>

    <div class="select ch-select" style="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; 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>

  • 相关阅读:
    从scanf的学习接口设计
    特现C语言编程特点的小代码,itoa,数值转换成字符串
    So many good projects for studying C programming lanuage.
    重要算法代码
    选择一本C++教材
    4412 内核模块传参数
    4412 GPIO初始化
    4412 物理地址
    4412 杂项设备
    4412 Linux设备总线
  • 原文地址:https://www.cnblogs.com/ch-zaizai/p/5150227.html
Copyright © 2020-2023  润新知