用户单击后更改JQuery Raty只读值

用户单击后更改JQuery Raty只读值,jquery,jquery-plugins,Jquery,Jquery Plugins,我想在单击事件中使Raty为只读,但它不起作用: $('#number').raty({ click: function(score, evt) { readOnly: true; //it does not work here $.get( "../../ajax/test.aspx", {r:score},

我想在单击事件中使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

            });

您需要在
img

$('#star').raty({
    click: function(score, evt) {
        $(this).find('img').unbind('click');
        // $(this).find('img').unbind(); <-- this removes all listeners
    }
});
​
$('#star').raty({
点击:功能(分数、evt){
$(this.find('img')。解除绑定('click');

//$(this).find('img').unbind();请添加对插件源代码的引用,这样我们就可以避免大量搜索。标记也可以帮助您详细说明什么不起作用?如果您的意思是看不到星星,那是因为我无法将图像上载到JSFIDLE。我还使用您的ID添加了一个新示例:我添加了
$(this).find('img')).unbind('click');
但我仍然可以评分。我只删除了发送评分的click事件。如果您想删除所有内容(例如,当您将鼠标悬停在星星上时星星会改变),您可以尝试
$(this)。查找('img').unbind();
。我还在Thank you上添加了一个完整的示例。Thank@khi:)还请在回答中添加您的评论,这很有价值;)