Фреймворки → плагин Star Rating для JQuery
Есть такой интересный плуг для организации оценок всего чего угодно в один клик под яваскриптовый фреймворк JQuery.
Здесь можно скачать и посмотреть на него.
http://plugins.jquery.com/project/MultipleFriendlyStarRating
http://www.fyneworks.com/jquery/star-rating/
Проблема с которой я столкнулся — невозможность задизейблить звезды после того, как пользователь проголосовал. Как минимум это приводит к заблуждению пользователя.
Решение:
$('.auto-submit-star').rating({
callback: function(value, link){
// 'this' is the hidden form element holding the current value
// 'value' is the value selected
// 'element' points to the link element that received the click.
$("#form-rating").ajaxSubmit({
success:function(data) {
//именно здесь начинаем дизейблить звезды
$("div", "#form-rating")
.removeClass("star_live")
.addClass("star_readonly")
.unbind("mouseover")
.unbind("mouseout")
.unbind("click");
//здесь закончили
$('#message').text("Your vote was counted");
},
error:function(data) {
form.fadeOut("slow");
$('#message').text("Error!");
}
});
}
});
Здесь можно скачать и посмотреть на него.
http://plugins.jquery.com/project/MultipleFriendlyStarRating
http://www.fyneworks.com/jquery/star-rating/
Проблема с которой я столкнулся — невозможность задизейблить звезды после того, как пользователь проголосовал. Как минимум это приводит к заблуждению пользователя.
Решение:
$('.auto-submit-star').rating({
callback: function(value, link){
// 'this' is the hidden form element holding the current value
// 'value' is the value selected
// 'element' points to the link element that received the click.
$("#form-rating").ajaxSubmit({
success:function(data) {
//именно здесь начинаем дизейблить звезды
$("div", "#form-rating")
.removeClass("star_live")
.addClass("star_readonly")
.unbind("mouseover")
.unbind("mouseout")
.unbind("click");
//здесь закончили
$('#message').text("Your vote was counted");
},
error:function(data) {
form.fadeOut("slow");
$('#message').text("Error!");
}
});
}
});



