![](/img/trans.png)
[英]How do I get the current displayed month and year of semantic-ui-calendar?
[英]Semantic UI Ratings not displayed
我無法顯示評級元素。 它根本不會出現。 所有其他事情都可以正常工作
我已經正確鏈接了這些:
我這樣使用它:
<div class="ui star rating" data-rating="4"></div>
我是否需要做其他事情才能使其正常工作?
您需要在jQuery
的.rating
div
元素上初始化rating
插件。
將其添加到您的.js
文件中:
// This waits for the DOM to load correctly before changing elements
$(document).ready(function(){
// All your normal JS code goes in here
$(".rating").rating();
});
或者,如果您沒有.js
文件,則可以在需要顯示等級的每個頁面上都包含此Javascript/jQuery
。
<script type="text/javascript">$(document).ready(function(){$(".rating").rating();});</script>
這將為您帶來相同的效果。
您還可以在初始化中指定其他選項:
$('.rating')
.rating({
initialRating: 3,
maxRating: 5
})
;
您可以在此處找到選項列表和其他示例: http : //semantic-ui.com/modules/rating.html
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.