0

我正在尝试根据网站上的说明设置 jQuery 按钮的样式,但它不起作用。我按照这里的说明操作:http: //jqueryui.com/button/#checkbox

我究竟做错了什么?这是我的代码:http: //jsfiddle.net/YrNxy/

HTML

    <div style="padding-bottom: 10px; padding-top: 10px;">
      <div class="modal_field">Day <strong style="color:#A00">(required)</strong>:</div>
      <div class="format">
        <input type="checkbox" class="check1" />
        <label for="check1">Mon</label>
        <input type="checkbox" class="check2" />
        <label for="check2">Tues</label>
        <input type="checkbox" class="check3" />
        <label for="check3">Wed</label>
        <input type="checkbox" class="check4" />
        <label for="check4">Thu</label>
        <input type="checkbox" class="check5" />
        <label for="check5">Fri</label>
      </div>
    </div>​

JS

$(function() {
        $( ".check" ).button();
        $( ".format" ).buttonset();
    });​
4

1 回答 1

1

问题是您的输入设置不正确。我为您修复了 JSBin 上的代码。请注意,该类已更改为复选框的 id(对于 = id 或标签和复选框的名称)。

http://jsbin.com/akulas/1/

于 2012-11-10T22:16:51.953 回答