Skip to content

Instantly share code, notes, and snippets.

@mo7amd
Last active March 21, 2017 12:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mo7amd/c49d641b1537e2e337163b76e0ec7f7f to your computer and use it in GitHub Desktop.
Save mo7amd/c49d641b1537e2e337163b76e0ec7f7f to your computer and use it in GitHub Desktop.
$(function(){
var selected = 0;
$('.rating__stars i').click(function(){
selected = $(this).index();
});
$('.rating__stars i').hover(
function(){
var index = $(this).index();
for(var i=0;i<index;i++){
$('.rating__stars i').eq(i).css("color","#ff9800");
}
},
function(){
// selected_rate();
for(var i=selected;i<5;i++){
$('.rating__stars i').eq(i).css("color","#cfcfcf");
}
}
);
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment