a.html
3.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>jquery星星评论动画效果</title>
<script src="jquery.min.js"></script>
<link href="stars.css" type="text/css" rel="stylesheet">
<script src="stars.js" type="text/javascript"></script>
<script type="text/javascript">
$(function(){
var options = {
max : 5,
title_format : function(value) {
var title = '';
switch (value) {
case 1 :
title = '很不满意';
break;
case 2 :
title = '不满意';
break;
case 3 :
title = '一般';
break;
case 4 :
title = '满意';
break;
case 5 :
title = '非常满意';
break;
default :
title = comment_rank;
break;
}
$('#rank').val(value);
//alert(value);
//alert(title);
return title;
},
info_format : function(value) {
var info = '';
switch (value) {
case 1 :
info = '<div class="info-box">1分 很不满意<div>商品样式和质量都非常差,太令人失望了!</div></div>';
break;
case 2 :
info = '<div class="info-box">2分 不满意<div>商品样式和质量不好,不能满足要求。</div></div>';
break;
case 3 :
info = '<div class="info-box">3分 一般<div>商品样式和质量感觉一般。</div></div>';
break;
case 4 :
info = '<div class="info-box">4分 满意<div>商品样式和质量都比较满意,符合我的期望。</div></div>';
break;
case 5 :
info = '<div class="info-box">5分 非常满意<div>我很喜欢!商品样式和质量都很满意,太棒了!</div></div>';
break;
default :
info = value;
break;
}
return info;
}
}
$('#rate-comm-1').rater(options);
})
</script>
<!--对评分内容判断-->
</head>
<body>
<center>
<form action="javascript:;" onsubmit="submitComment(this)">
<div class=box-163css>
<div class="mb10 goods-comm-stars clearfix" style="position:relative;z-index:2;">
<div class=fl><SPAN class="color-r mr5">*</SPAN>商品满意度:</div>
<div class=rate-comm id=rate-comm-1></div>
<br><br>
</div>
</div>
<input name="rank" id="rank" type="hidden" value=""><br><br>
<input name="submit1" type="submit" value=" 提交评分 ">
</form>
</center>
<script type="text/javascript">
function submitComment(frm)
{
var cmt = new Object;
cmt.rank = frm.elements['rank'].value;
alert(cmt.rank);
return false;
}
</script>
</body></html>