代码之家  ›  专栏  ›  技术社区  ›  scottyaim

可以看到JQuery Mobile字段集选项处于受控状态

  •  0
  • scottyaim  · 技术社区  · 7 年前

    <fieldset data-role="controlgroup" data-type="horizontal" id="time-period-type">
        <input type="radio" name="time-period" id="weekly-time-period" value="weekly" checked="checked">
        <label for="weekly-time-period">WEEKS</label>
        <input type="radio" name="time-period" id="monthly-time-period" value="monthly">
        <label for="monthly-time-period">MONTHS</label>
        <input type="radio" name="time-period" id="yearly-time-period" value="yearly">
        <label for="yearly-time-period">YEARS</label>
    </fieldset>

    enter image description here

    1 回复  |  直到 7 年前
        1
  •  0
  •   Durga    7 年前

    #time-period-type > input{
      display      :  none;
      //opacity    :  0;
    }
    <fieldset data-role="controlgroup" data-type="horizontal" id="time-period-type">
        <input type="radio" name="time-period" id="weekly-time-period" value="weekly" checked="checked">
        <label for="weekly-time-period">WEEKS</label>
        <input type="radio" name="time-period" id="monthly-time-period" value="monthly">
        <label for="monthly-time-period">MONTHS</label>
        <input type="radio" name="time-period" id="yearly-time-period" value="yearly">
        <label for="yearly-time-period">YEARS</label>
    </fieldset>

    设置 display : none 添加到输入元素,或者添加 opacity :0