GithubHelp home page GithubHelp logo

Comments (4)

kartik-v avatar kartik-v commented on August 19, 2024 1

Its a simple math....

  • starting from 1 and ending at 5 with step = 1 --- you can only have 4 stars (if you need whole stars to be highlighted). But since you have mentioned 5 stars, the plugin will highlight 5/(5-1) = 1.25 stars for value = 1.
  • so starting 0 and ending with 5 with step = 1 you can have 5 stars for whole stars
  • starting with 1 and ending with 6 with step = 1 you can have 5 stars for whole stars

from bootstrap-star-rating.

mpavel avatar mpavel commented on August 19, 2024

Here are my settings:

{
               min: 1,
                max: 5,
                step: 1,
                showClear: false,
                showCaption: false,
                size: 'xs',
                symbol: '☆'
}

I noticed that the div.rating-stars has width: 25% when hovering on the first element. Should this not be 20%? If there are 5 stars? (100/5 = 20) ...

from bootstrap-star-rating.

mpavel avatar mpavel commented on August 19, 2024

If I set

min: 0

it works. Don't know why, but if min is set to 1, the out.val variable starts at 2 when hovering over the stars, in star-rating.js:367

from bootstrap-star-rating.

mpavel avatar mpavel commented on August 19, 2024

Hi,

I just thought it would use the normal input[type=number] "logic". http://jsbin.com/xejunufusu/1/

In the example, min=1, max=5 and to me it seems that this makes sense. If you leave the input empty (no value), no stars should be highlighted (use the cancel button). Otherwise, it starts from 1 star (=1) up to 5 stars (=5).

But once I figured out it needs to be 0 - 5 it's fine, and works OK.

Thanks!

from bootstrap-star-rating.

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.