Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't change the ratedColor #55

Open
pow44feet opened this issue Dec 7, 2020 · 7 comments
Open

Can't change the ratedColor #55

pow44feet opened this issue Dec 7, 2020 · 7 comments

Comments

@pow44feet
Copy link

I'm doing all exactly the same as the examples on guide, but only ratedColor is always set up on the crimson color. Have any descisions how to fix the bug?

ratedColor: '#F95A59',

@sercuu
Copy link

sercuu commented Dec 10, 2020

Try to use like that.
ratedColor: "#fbbc04 !important"

@wpas81
Copy link

wpas81 commented Jan 3, 2021

I got the same issue. You may want to fix that. Excellent script beside that minor thingie :) Many thanks!

@mfrank4101
Copy link

To correct the issue, you need to change Line 177-182 in jquery.star-rating-svg.js:

FROM:

var ratedColor; if (s.ratedColors && s.ratedColors.length && s.ratedColors[ratedColorsIndex]) { ratedColor = s.ratedColors[ratedColorsIndex]; } else { ratedColor = this._defaults.ratedColor; }

TO:

var ratedColor; if (s.ratedColor && s.ratedColor.length ) { ratedColor = s.ratedColor; } else { ratedColor = this._defaults.ratedColor; }

@wilmer2000
Copy link

Try to use like that.
ratedColor: "#fbbc04 !important"

It doesn't work properly :(

@helloanoop
Copy link

This worked for me.

$(".rating-stars").starRating({
      starSize: 25,
      totalStars: 5,
      initialRating: 0,
      ratedColors: ['#ffa700', '#ffa700', '#ffa700', '#ffa700', '#ffa700']
});

@buinhan0109
Copy link

Change version
jQuery StarRatingSvg v0.9.5
from https://www.jqueryscript.net/demo/SVG-Based-Star-Rating-Plugin-For-jQuery-star-rating-svg-js

@nhantam
Copy link

nhantam commented May 3, 2024

Just test working well:
$(".my-rating-custom").starRating({
starSize: 40,
initialRating: 0,
readOnly: true,
starGradient: {
start: '#0064d3', /* your color here /
end: '#0064d3' /
your color here */
},
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants