console
$('#star1').bhStar({
score: 3
});
$('#star2').bhStar({
size: 30
});
$('#star3').bhStar({
text: 'Vote'
});
$('#star4').bhStar({
starClass: 'cls-star',
textClass: 'cls-text'
});
$('#star5').bhStar({
isShowNum: false
});
$('#star6').bhStar();
$("#star7").bhStar({
score: 2,
size: 0,
isShowNum: true,
text: '分',
textClass: 'abc',
starClass: 'star',
readonly: true
});
$('.e2e-opt').on('click', 'button', function () {
$('mark').html($('#star6').bhStar('getScore'));
});
<h3 class='bh-mt-16'>设置默认score</h3>
<div id="star1"></div>
<h3 class='bh-mt-16'>设置星星size</h3>
<div id="star2" class='bh-mt-8'></div>
<h3 class='bh-mt-16'>设置单位</h3>
<div id="star3" class='bh-mt-8'></div>
<h3 class='bh-mt-16'>给星星和文字添加自定义样式类</h3>
<div id="star4" class='bh-mt-8'></div>
<h3 class='bh-mt-16'>隐藏数字</h3>
<div id="star5" class='bh-mt-8'></div>
<h3 class='bh-mt-16'>获取评分</h3>
<div id="star6" class='bh-mt-8 bh2-pull-left'></div>
<h3 class='bh-mt-16'>只读评分</h3>
<div id="star7" class='bh-mt-8 bh2-pull-left'></div>
<div class="e2e-opt">
<button data-action="getScore">获取当前评分</button>
</div>
<mark>
返回状态
</mark>
#wrap{
margin: 16px;
}