Coder Social home page Coder Social logo

Comments (5)

janones avatar janones commented on July 26, 2024 8

Or alter method paintStars() and add these two "Elses"

if (index <= Math.ceil(endIndex) || (index < 1 && endIndex < 0)) { $polygonLeft.attr('style', 'fill:'+ratedColor); } else { //lets you deselect stars $polygonLeft.attr('style', 'stroke-opacity: 0;'); }
if (index <= endIndex) { $polygonRight.attr('style', 'fill:'+ratedColor); } else { //lets you deselect stars $polygonRight.attr('style', 'stroke-opacity: 0;'); }

from star-rating-svg.

janones avatar janones commented on July 26, 2024 7

the paintStars() method looks like this after the change:

image

lines with corrections 192 and 200

from star-rating-svg.

gabidabet avatar gabidabet commented on July 26, 2024 2

yeah it work internally but not visually, comment this code and you will be fine :
if (stateClass === 'rated' && endIndex > -1) { // limit to painting only to rated stars, and specific case for half star if (index <= Math.ceil(endIndex) || (index < 1 && endIndex < 0)) { $polygonLeft.attr('style', 'fill:'+ratedColor); } if (index <= endIndex) { $polygonRight.attr('style', 'fill:'+ratedColor); } }

from star-rating-svg.

matuskm avatar matuskm commented on July 26, 2024

hello,

where should i put it ?

from star-rating-svg.

nibblebits avatar nibblebits commented on July 26, 2024

Don't forget to set disableAfterRate to false if your still having this problem after making these changes.

from star-rating-svg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.