$('.star').mouseover(function (){
var star = $(this).index()1;
$(this).parent().css("background-position","0 -" (32 * star) "px");
});
$('.star-rating').mouseout(function (){
var originalresult = $(this).attr('id').split('result')[1];
$(this).css("background-position","0 -" (32 * originalresult) "px");
});
Don’t get this, rewriting is giving me stars in my eyes, but the problem stands… Don’t know anymore what I’m doing wrong?
var star = $(this).index()1;there is an extra 1 at the end.$(this).parent().css("background-position","0 -" (32 * star) "px");$(this).css("background-position","0 -" (32 * originalresult) "px");All the string concatenation should be joined with
+;