等级选择,星级选择 长条状比例选择等

XML/HTML Code
- <div id="wrapper">
- <div id="content">
- <div class="buttons">
- <button class="blue-pill deactivated rating-enable">enable</button>
- <button class="blue-pill rating-disable">disable</button>
- </div>
- <div class="input select rating-a">
- <label for="example-a">Rating (example A):</label>
- <select id="example-a" name="rating">
- <option value="1">1</option>
- <option value="2">2</option>
- <option value="3">3</option>
- <option value="4">4</option>
- <option value="5">5</option>
- <option value="6">6</option>
- <option value="7" selected="selected">7</option>
- <option value="8">8</option>
- <option value="9">9</option>
- <option value="10">10</option>
- </select>
- </div>
- <div class="input select rating-b">
- <label for="example-b">Rating (example B):</label>
- <select id="example-b" name="rating">
- <option value="Bad">Bad</option>
- <option value="Mediocre">Mediocre</option>
- <option value="Quite good">Quite good</option>
- <option value="Awesome">Awesome</option>
- </select>
- </div>
- <div class="input select rating-c">
- <label for="example-c">Rating (example C):</label>
- <select id="example-c" name="rating">
- <option value=""></option>
- <option value="1">1</option>
- <option value="2">2</option>
- <option value="3">3</option>
- <option value="4">4</option>
- <option value="5">5</option>
- </select>
- </div>
- <div class="input select rating-d">
- <label for="example-d">Rating (example D):</label>
- <select id="example-d" name="rating">
- <option value="1">1</option>
- <option value="2">2</option>
- <option value="3">3</option>
- <option value="4">4</option>
- <option value="5">5</option>
- <option value="6">6</option>
- <option value="7">7</option>
- <option value="8">8</option>
- <option value="9">9</option>
- <option value="10">10</option>
- </select>
- </div>
- <div class="input select rating-e">
- <label for="example-e">Rating (example E), with a callback:</label>
- <select id="example-e" name="rating">
- <option value="D">D</option>
- <option value="C">C</option>
- <option value="CC">CC</option>
- <option value="CCC-">CCC-</option>
- <option value="CCC">CCC</option>
- <option value="CCC+">CCC+</option>
- <option value="B-">B-</option>
- <option value="B">B</option>
- <option value="B+">B+</option>
- <option value="BB-">BB-</option>
- <option value="BB">BB</option>
- <option value="BB+">BB+</option>
- <option value="BBB-">BBB-</option>
- <option value="BBB">BBB</option>
- <option value="BBB+">BBB+</option>
- <option value="A-">A-</option>
- <option value="A" selected="selected">A</option>
- <option value="A+">A+</option>
- <option value="AA-">AA-</option>
- <option value="AA">AA</option>
- <option value="AA+">AA+</option>
- <option value="AAA">AAA</option>
- </select>
- </div>
- <div class="input select rating-f">
- <label for="example-f">Star rating... why not:</label>
- <select id="example-f" name="rating">
- <option value="1">1</option>
- <option value="2">2</option>
- <option value="3">3</option>
- <option value="4">4</option>
- <option value="5">5</option>
- </select>
- </div>
- </div>
- </div>
JavaScript Code
- <script type="text/javascript">
- $(function () {
- $('.rating-enable').click(function () {
- $('#example-a, #example-b').barrating();
- $('#example-c, #example-d').barrating('show', {
- showValues:true,
- showSelectedRating:false
- });
- $('#example-e').barrating('show', {
- showValues:true,
- showSelectedRating:false,
- onSelect:function(value, text) {
- alert('Rating: ' + value);
- }
- });
- $('#example-f').barrating({ showSelectedRating:false });
- $(this).addClass('deactivated');
- $('.rating-disable').removeClass('deactivated');
- });
- $('.rating-disable').click(function () {
- $('select').barrating('destroy');
- $(this).addClass('deactivated');
- $('.rating-enable').removeClass('deactivated');
- });
- $('.rating-enable').trigger('click');
- });
- </script>
原文地址:http://www.freejs.net/article_biaodan_183.html
最近更新
- 响应式全屏手风琴菜单,同时支持垂直方...
- 分组select选择器,支持多选和单...
- jQuery时间日期选择器代码日历插...
- Select 选择器 可以清空的单选...
- jQuery json 无刷新翻页 ...
- 纯css3带倒影效果的图片翻转特效
我爱薅羊毛
点击最多
广告赞助
相关文章
- 美化input radio select等输入框,...
- select 下拉框多选,用select代替che...
- jQuery下拉多选插件 下拉框复选 包括全选
- radio单选框彩色,自定义边框,圆点颜色和大小
- 自定义checkbox和radio样式 圆形方形...
- select下拉菜单带图片