javascript - Controling RatedFill in RateYo using CSS -
i using great little jquery plugin called rateyo in application.
it uses svgs method creating stars great improvement on traditional method of using images, appears prevent using css control color of rated stars.
so can like:
$("#rateyo").rateyo({ normalfill: "#a0a0a0", ratedfill: "#f39c12" });
however obvious reasons control these parameters through css rather javascript.
i have tried simple
.rating svg { fill: $blue3; }
which change color of stars prevents control functioning correctly because fixes color of stars fill color provided in css.
so, please provide suggestions on how might able control ratedfill
parameter through css rather javascript?
by inspecting markup rateyo creates, can find relevant classes , target them.
here's live example:
$(function() { $(".rating").rateyo({ rating: 2.5 }); });
.rating .jq-ry-normal-group svg { fill: silver; } .rating .jq-ry-rated-group svg { fill: blue; }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/rateyo/2.3.2/jquery.rateyo.min.js"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/rateyo/2.3.2/jquery.rateyo.min.css"> <div class="rating"></div>
Comments
Post a Comment