0

我无法绑定事件“onchange” http://georgepaterson.github.com/jquery-ui/selectgroup/

这个插件隐藏了选择器

<select class="select-list">
    <option value="option1" selected="selected">Option 1</option>
    <option value="option2">Option 2</option>
</select>

$(document).ready(function(){
    $('.select-list').selectgroup({
        style: 'popup'
    });
});
4

2 回答 2

0

该插件将选择框的html结构更改为ul,因此您需要像这样为li单击编写一个函数

jQuery(document).ready(function(){
    jQuery('.ui-selectgroup-list li a').click({
      alert(jQuery(this).html());
    });
});
于 2012-12-18T09:52:20.687 回答
0

$ 是 jQuery 关键字的快捷方式,所以试试这样:

jQuery(document).ready(function(){
    jQuery('.select-list').selectgroup({
      style: 'popup'
    });
});
于 2012-12-18T09:48:35.837 回答