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

            });

Ratyホームページ

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 に答える