jQuery星级评分插件

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>家电维修</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Customer2/css/reset.css">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Customer2/css/base.css">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Customer2/css/layout.css">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Customer2/css/iscroll.css">
<script src="__PUBLIC__/Customer2/js/jquery.min.js"></script>
<script src="__PUBLIC__/Customer2/js/iscroll.js"></script>
<script src="__PUBLIC__/Home/js/jquery.raty.min.js"></script>
</head>
<body>
    <form action='{:U("Cusreview/cus_review_do")}' method='post' >
    <header class="header-wrapper index-header">
        <a class="city-link" href="city.html">
            <i class="index-icon icon-return"></i>
            <span class="city-name">返回</span>
        </a>
        <div class="title">评价</div>
    </header>

    <article>
        <section>
            <div class="info-box">
            <volist name='list' id='vo' >
                <div class="info-block">
                    <span>{$vo.content}</span>
                    <span class="evalua r">
                        <div   class="star"></div>
                        <input type="hidden"  value='{$vo.eight_ratio}' name='eight_ratio[{$vo.id}]' />
                        <input type="hidden"  value='{$vo.eight_ratio}' name='rate[{$vo.id}]'/>
                    </span>
                 </div>
            </volist>
                <div class="info-block info-block2">
                    <span">评价:</span><br/>
                    <input type="hidden" value='{$wid}' name='order_id' />
                    <textarea placeholder="字数在200字以内" class="evalua-text mt10" name='text_records'></textarea>
                 </div>
            </div>
        </section>

        <section class="mt10">
            <a class="button" onclick='sub_datas();'>确定</a>
        </section>

    </article>

    <footer>

    </footer>
</form>
</body>

<script type="text/javascript">
    function sub_datas(){
        var get_text_content=$.trim($('.evalua-text').val());
        if(!get_text_content){
            alert('评价内容不能为空!');
            return false;
        }
        var get_content_length=get_text_content.length;
        if(get_content_length>0&&get_content_length<6){
            alert('评价内容过短,不少于6个字!');
            return false;
        }
        if(get_content_length>200){
            alert('评论字数超过限制,请不要超出200字!');
            return false;
        }
        $('form').submit();
    }
</script>

<script type="text/javascript">
var d=$(".star");
$.each(d,function(i,v){
    var tar=$(this).next('input');
    $(this).raty({
        path:"__PUBLIC__/Home/images/" ,
        starOff: 'star-off-big.png',
        starOn: 'star-on-big.png',
        size:26,
        hints: ['1.0', '2.0', '3.0', '4.0', '5.0'],
        target: tar,
        targetKeep : true
    });
})
</script>
</html>
上一篇:jquery 星级评价插件jquery Raty的使用


下一篇:POJ 3261 Milk Patterns ( 后缀数组 && 出现k次最长可重叠子串长度 )