我从这里找到了创建星级的方法
但是当我在 Intel XDK 上通过 Intel App Framework 3.0 实现时,它无法投票。我的代码是:
CSS 和 HTML:
.rating {
unicode-bidi: bidi-override;
direction: rtl;
text-align: center;
font-size: 30px;
}
.rating > span {
display: inline-block;
position: relative;
width: 1.1em;
}
.rating > span:hover,
.rating > span:hover ~ span,
.rating:not(:hover) > input:checked ~ span {
color: transparent;
}
.rating > span:hover:before,
.rating > span:hover ~ span:before,
.rating:not(:hover) > input:checked ~ span:before {
content: "\2605";
position: absolute;
left: 0;
color: gold;
}
.rating > input {
margin-left: -2.8em;
margin-right: 0;
top: 3px;
width: 2.1em;
height: 2.1em;
position: relative;
z-index: 2;
opacity: 0;
}
<div class="rating">
<input name="myrating" type="radio" value="5">
<span>☆</span>
<input name="myrating" type="radio" value="4">
<span>☆</span>
<input name="myrating" type="radio" value="3">
<span>☆</span>
<input name="myrating" type="radio" value="2">
<span>☆</span>
<input name="myrating" type="radio" value="1">
<span>☆</span>
</div>
我在af.ui.css中发现,没有标签时输入类型radio不会显示:
input[type="radio"],input[type="checkbox"] {display: none;}
我该怎么办?