gjunge / rateit.js

Rating plugin for jQuery. Fast, Progressive enhancement, touch support, icon-font support, highly customizable, unobtrusive JavaScript (using HTML5 data-* attributes), RTL support, supports as many stars as you'd like, and also any step size.
MIT License
161 stars 45 forks source link

Parent elements with "display: none" breaks rating bar #31

Open lordplagus02 opened 4 years ago

lordplagus02 commented 4 years ago

Parent elements that have a css attribute of "display: none" somewhere during DOM load prevents the rating bar from displaying any stars or receiving any clicks. The stars remain empty regardless of value.

gjunge commented 4 years ago

I would reinitiate RateIt it whenever the parent gets shown. When we initiate it, we calculate the width and height, in order to know how much is "rating" is each mouse move. When it is hidden there is no width nor height.