I am facing a challenging issue with my star rating system. Initially, I receive stars from CMS and assign them unique IDs.
When the page is not rated, it appears as follows:
<div class="rated">
<a class="star" href="#" onclick="star(1,6226,0,0,1439 ,0)" "="">
<span>★</span>
</a>
<a class="star" href="#" onclick="star(2,6226,0,0,1439 ,0)" "="">
<span>★</span>
</a>
<a class="star" href="#" onclick="star(3,6226,0,0,1439 ,0)" "="">
<span>★</span>
</a>
<a class="star" href="#" onclick="star(4,6226,0,0,1439 ,0)" "="">
<span>★</span>
</a>
<a class="star" href="#" onclick="star(5,6226,0,0,1439 ,0)" "="">
<span>★</span>
</a>
</div>
(@Admin , Moderator - how to make new lines ??)
When the page is rated, it appears like this:
<div class="punkty" id="punkty1445">
<div class="rating">
<a class="star" href="#" onclick="star(1,6256,6,2,1445 ,3)">
<span>★</span>
</a>
<a class="star" href="#" onclick="star(2,6256,6,2,1445 ,3)">
<span>★</span>
</a>
<a class="star" href="#" onclick="star(3,6256,6,2,1445 ,3)">
<span>★</span>
</a>
</div>
<div class="rated">
<a class="star" href="#" onclick="star(4,6256,6,2,1445 ,3)" "="">
<span>★</span>
</a>
<a class="star" href="#" onclick="star(5,6256,6,2,1445 ,3)" "="">
<span>★</span>
</a>
</div>
<span class="oc" itemprop="average" id="glos1445" style="font-weight:bold;margin-right: 10px;">3</span>
</div>
In the second example, the average page rate is indicated by the class "rating" (displayed in green). The "rated" class shows the stars to be voted on (in this case 3 green stars, 2 blue stars). In the first example, all 5 stars are blue and clickable until someone votes for 5, turning them into green stars. I hope that explanation makes sense.
Now, onto my question: How can I change the color of stars from left to right when pointing to one? For instance, if I point to the third star, the first, second, and third stars should change to gold. I attempted to achieve this using CSS but they turned gold from right to left. I suspect hard-core jQuery may be necessary for this task. Please assist me, as this is crucial.