当前位置: 代码迷 >> Web前端 >> 施用jquery评分,二维码插件
  详细解决方案

施用jquery评分,二维码插件

热度:155   发布时间:2012-09-20 09:36:50.0
使用jquery评分,二维码插件
介绍下jquery评分和二维码的插件使用:
jquery评分插件使用如下:
<script type="text/javascript" src="${urls?.staticUrl}/public/javascripts/jquery.raty.min.js"></script>
html:
<ul class="fen">
  <li>椒友评分:
<a id="star" data-rating="${scoreInfo?.avgScore}"></a><span id="star-target" class="fenstar"></span>
  </li>
</ul>
js:
$('#star').raty({
starOn:   'score-on.png',
  starOff:  'score-off.png',
  starHalf: 'score-half.png',
  halfShow:?true,
        target : '#star-target',
        targetFormat: '{score} (已有${scoreInfo?.count}人评分)',
        targetKeep:    true,
        width : 120,
  //half:?    true,
  //precision:  true,
  number:   5,
  path:'${urls?.staticUrl}/public/images/android/softinfo/',
  hintList: ['差', '较差', '还行', '推荐', '力荐'],
  //round: { down: .25, full: .6, up: .76 },
  start: function() {
???? return $(this).attr('data-rating');
?? },
click: function(score, evt) {
var resname = "${softMap?.name}";
var id = "${softMap?.resource_id}";
submitScore(id, resname, 1, score);
$(this).raty('readOnly', true);
?? }
});
上身方法即可,参数解析:hintList鼠标移上去显示相应的信息,number星星的数量,starOn亮图片,starOff不亮图片,starHalf显示半亮图片名称,path图片地址,submitScore里面保存使用的参数.

jquery二维码的使用:
<script type="text/javascript" src="${urls?.staticUrl}/public/javascripts/jquery.MyQRCode.js"></script>
<script type="text/javascript">
            $("#QRCode").MyQRCode({
            encoding: "UTF-8",
        content: "${urls?.webSoftUrl}/android/down/${softMap?.id}/${softMap.resource_id}.html?type=1",
        size: "90x90",
                        alt:"下载 ${softMap?.name} 二维码",
                        title : "下载 ${softMap?.name} 二维码"
            });
</script>
  相关解决方案