I cannot make the ratings element displayed. It simply does not appear. All other things work fine enough
I have linked these properly:
And I use it like this:
<div class="ui star rating" data-rating="4"></div>
Do I need to do something else to make it work?
I cannot make the ratings element displayed. It simply does not appear. All other things work fine enough
I have linked these properly:
And I use it like this:
<div class="ui star rating" data-rating="4"></div>
Do I need to do something else to make it work?
https
instead of http
sorry.
– Fᴀʀʜᴀɴ Aɴᴀᴍ
Commented
Dec 16, 2015 at 16:45
$('.rating').rating();
;
– chriz
Commented
Dec 16, 2015 at 16:48
You need to initialize the rating
plugin on the .rating
div
element in jQuery
.
Either add this to your .js
file:
// This waits for the DOM to load correctly before changing elements
$(document).ready(function(){
// All your normal JS code goes in here
$(".rating").rating();
});
Or if you don't have a .js
file you can just include this Javascript/jQuery
on each page the rating needs displayed.
<script type="text/javascript">$(document).ready(function(){$(".rating").rating();});</script>
And that will give you the same effect.
You can also specify different options within the initialization:
$('.rating')
.rating({
initialRating: 3,
maxRating: 5
})
;
You can find a list of options and other examples here: http://semantic-ui./modules/rating.html