Reputation: 95
my poor js drives me crazy. i used a jquery plugin called raty, which is a star rating plugin
i used it like this way
$('span.sessionRating').raty({starOff: 'images/star-off.png', starOn: 'images/star-on.png', click: sessionRate});
function sessionRate (score, evt) {
$(this).raty ({readOnly:true});
}
the problem is $(this).raty ({readOnly:true})
will recreate the star rating again. so i am wondering how can we reset the option without recreating everything;
thanks. i have googled a lot, but found no answer!
Upvotes: 1
Views: 124
Reputation: 35012
From the documentation:
$('div').raty('readOnly', boolean); // Change the read-only state.
So you could try this:
function sessionRate (score, evt) {
$(this).raty('readOnly', true);
}
Upvotes: 1