星级选择器 有半星级选择
本站还有其他类似的案例,请搜索“星级”查看
XML/HTML Code
- <form>
- <input id="input-2b" type="number" class="rating" min="0" max="5" step="0.5" data-size="xl"
- data-symbol="" data-default-caption="{rating} hearts" data-star-captions="{}">
- <br>
- <input id="input-21a" value="0" type="number" class="rating" min=0 max=5 step=0.5 data-size="xl" >
- <br>
- <input id="input-21b" value="4" type="number" class="rating" min=0 max=5 step=0.2 data-size="lg">
- <br>
- <input id="input-21c" value="0" type="number" class="rating" min=0 max=8 step=0.5 data-size="xl" data-stars="8">
- <br>
- <input id="input-21d" value="2" type="number" class="rating" min=0 max=5 step=0.5 data-size="sm">
- <br>
- <input id="input-21e" value="0" type="number" class="rating" min=0 max=5 step=0.5 data-size="xs" >
- <br>
- <input id="input-21f" value="0" type="number" class="rating" min=0 max=5 step=0.5 data-size="md" >
- <br>
- <input id="input-2ba" type="number" class="rating" min="0" max="5" step="0.5" data-stars=5
- data-symbol="" data-default-caption="{rating} hearts" data-star-captions="{}">
- <br>
- <input id="input-22" value="0" type="number" class="rating" min=0 max=5 step=0.5 data-rtl=1 data-container-class='' data-glyphicon=0>
- <div class="clearfix"></div>
- <div class="form-group">
- <button type="submit" class="btn btn-primary">Submit</button>
- <button type="reset" class="btn btn-default">Reset</button>
- </div>
- </form>
JavaScript Code
- <script>
- jQuery(document).ready(function () {
- $(".rating-kv").rating();
- });
- </script>
原文地址:http://www.freejs.net/article_biaodan_416.html