star-rating-svg
star-rating-svg copied to clipboard
Can't change the ratedColor
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',
Try to use like that. ratedColor: "#fbbc04 !important"
I got the same issue. You may want to fix that. Excellent script beside that minor thingie :) Many thanks!
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; }
Try to use like that. ratedColor: "#fbbc04 !important"
It doesn't work properly :(
This worked for me.
$(".rating-stars").starRating({
starSize: 25,
totalStars: 5,
initialRating: 0,
ratedColors: ['#ffa700', '#ffa700', '#ffa700', '#ffa700', '#ffa700']
});
Change version jQuery StarRatingSvg v0.9.5 from https://www.jqueryscript.net/demo/SVG-Based-Star-Rating-Plugin-For-jQuery-star-rating-svg-js
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 */ }, });