Comments (5)
hoangnamitc try this:
js
$(".my-rating").starRating({ starSize: 15, callback: function(currentRating, $el) { value = $($el).data('init'); } })
from star-rating-svg.
Do you want to read it from a DB?, how are you rendering your pages?
You have several options depending on what you're most familiar with.
You can server render the value in a JS variable and use it as a setting,
or you can also wait until your server call is done loading and then initialize the plugin
If you still need help let me know more details about your setup
from star-rating-svg.
I want read data of attribute initial plugin.
eg:
<div class="my-rating" data-init="3" data-readonly="true"></div>
how to me can get attribute data: init, readonly for parameters of plugin ? tks
from star-rating-svg.
@greeninho Thanks you answer, but function callback run when you click rating, I want get data from attribute of element for do parameter for starRating();
i'm can not do it.
from star-rating-svg.
You can use this js file instead js file link
and in your code you should do like this:
<div class="my-rating" data-readonly="{{$order->rate ? true : false}}" data-rating="{{$order->rate}}" id="{{$order->id}}"></div>
from star-rating-svg.
Related Issues (20)
- Dynamic initial vlue HOT 3
- Stars appear black on iOS HOT 2
- content loaded through ajax HOT 1
- Now it does not working with Chrome 73.0.3683.103 HOT 1
- Stars not displayed HOT 2
- Custom polygon HOT 1
- Stars don't change size + are displayed vertically HOT 2
- If you vote a high value and then vote a low value, the stars do not change to low value HOT 5
- Found and fixed issue when using setRating option HOT 1
- Decrease rank not visible but rank changed HOT 1
- disableAfterRate cannot enter a lower rating HOT 5
- setRating HOT 1
- Can't change the ratedColor HOT 7
- How can I save the currentRating in rails
- disableAfterRate: false => allows me to edit only to raise stars up not to get it down HOT 4
- Re-update html doom element HOT 1
- SVGs generates zyllion validation errors
- Unexpected behavior in "disableAfterRate: false" HOT 2
- starRating 0/zero, not working
- Unset method doesn't work properly
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from star-rating-svg.