star-rating-svg icon indicating copy to clipboard operation
star-rating-svg copied to clipboard

Can't change the ratedColor

Open pow44feet opened this issue 4 years ago • 7 comments

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',

pow44feet avatar Dec 07 '20 12:12 pow44feet

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

sercuu avatar Dec 10 '20 17:12 sercuu

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

wpas81 avatar Jan 03 '21 21:01 wpas81

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; }

mfrank4101 avatar Mar 30 '21 21:03 mfrank4101

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

It doesn't work properly :(

wilmer2000 avatar Jun 01 '21 23:06 wilmer2000

This worked for me.

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

helloanoop avatar Sep 11 '21 19:09 helloanoop

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

buinhan0109 avatar Jun 21 '23 06:06 buinhan0109

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 */ }, });

nhantam avatar May 03 '24 03:05 nhantam