3

我想在点击事件中将 Raty 设为只读,但它不起作用:

            $('#number').raty({
            click: function(score, evt) {
                readOnly: true; //it does not work here
                $.get(
                "../../ajax/test.aspx",
                {r:score},
                function (data) { alert(data); },
                "html"
        );

                },
            scoreName: 'entity.score',
            number: 10

            });

拉蒂主页

4

1 回答 1

7

您需要取消绑定点击事件img

$('#star').raty({
    click: function(score, evt) {
        $(this).find('img').unbind('click');
        // $(this).find('img').unbind(); <-- this removes all listeners
    }
});
​

http://jsfiddle.net/xnZVd/

于 2012-04-04T12:32:54.390 回答