jquery发表评论
『壹』 jquery如何实现发表评论
jquery是用来做前台的框架,用jquery可以做一个评论框的样式,但你要实现评论的功能还是要版用后台的语言的,权光用jquery是实现不了的,因为jquery是不能操作数据库的,不知道我这样回答你能不能明白
『贰』 如何用jquery实现新浪微博 回复评论后出现的那个 回复成功的对话框,然后1秒钟自动关闭的功能
artDialog,国人开发的一款优秀的javascript对话框组件,有jquery插件版本
『叁』 jquery 如何实现评论内容即时显示
如果你只要前端显示的话就用DOM,创建一个onclick函数,var newText=document.getElementById("...").value; ,然后创建新文本var addText=createTextnode(newText);,再在评版论列权表.appendChild(addText);
如果要保存在服务器再从中读取的话就得用AJAX了
『肆』 在html上用 jquery 怎么做评论星星
html部分:
<table class="block">
	<tr>
		<td>
			<span class="label">总体评价<em>*</em>:</span>
		</td>
		<td>
			<div class="rating-wrap">
				<ul class="rating-wrap-ul"  onmouseout="onUlMouseOut()" onmouseover="onUlMouseOver()">
					<li><a class="one-star" title="很差" data-hint="很差" href="javascript:clickStar(1);" onmouseover="onLiMouseOver(1)" onmouseout="onLiMouseOut()"></a></li>
					<li><a class="two-stars" title="差" data-hint="差" href="javascript:clickStar(2);" onmouseover="onLiMouseOver(2)" onmouseout="onLiMouseOut()"></a></li>
					<li><a class="three-stars" title="还行" data-hint="还行" href="javascript:clickStar(3);" onmouseover="onLiMouseOver(3)" onmouseout="onLiMouseOut()"></a></li>
					<li><a class="four-stars" title="好" data-hint="好" href="javascript:clickStar(4);" onmouseover="onLiMouseOver(4)" onmouseout="onLiMouseOut()"></a></li>
					<li><a class="five-stars" title="很好" data-hint="很好" href="javascript:clickStar(5);" onmouseover="onLiMouseOver(5)" onmouseout="onLiMouseOut()"></a></li>
				</ul>
			</div>
			<span id="ratingText" class="active-hint" innerText=""></span>
		</td>
	</tr>
	<tr>
		<td>
			<span class="label">评价<em>*</em>:</span>
		</td>
		<td>
			<span class="note">(50-2000个字)</span>
			<span id="textCount" class="note" innerText=""></span>
		</td>
	</tr>
	<tr>
		<td>
		</td>
		<td>
			<textarea name="appraiseText" id="appraiseText" class="form-content-block form-textarea" rows="12"></textarea>
		</td>
	</tr>
	<tr>
		<td>
		</td>
		<td align="right">
			<input type="button" value="提交" onclick="submitAppraise()">
			<input type="button" value="关闭" onclick=" ">
		</td>
	</tr>
</table>
CSS:
body {
	color: #333;
	font: normal normal normal 12px/1.5 Arial, 宋体, sans-serif;
}
.block{
	clear: both;
	margin-bottom:20px;
	margin-bottom: 10px;
	zoom: 1;
	padding:5px 11px;border:1px solid #F5EEE8;
	padding-top:10px;margin:0 10px 0;
	padding-bottom:20px;border-bottom:1px dashed #E4E4E4;
	margin:10px auto;padding:0;border:none;
}
.label{
	float:right;
	margin-right: 10px;
	text-align: right;
	font-weight: normal;
	font-style:normal;
	width: 94px;
}
em{
	margin-right:5px;
	color:#c00;
	font-weight:bold;
	font-style:normal;
	margin-left:2px;
}
.note {
	color: #999;
}
.form-textarea{
	float: left;
	font-family: Tahoma, Geneva, sans-serif;
	margin-right: 5px;
	width: 598px;
	zoom: 1;
	font-family: inherit;
	font-size: 100%;
	-webkit-appearance: textarea;
	-webkit-box-orient: vertical;
	-webkit-rtl-ordering: logical;
	-webkit-user-select: text;
	background-color: white;
	border: 1px solid;
	cursor: auto;
	padding: 2px;
	resize: auto;
	white-space: pre-wrap;
	word-wrap: break-word;
}
		
.rating-wrap {
	display: inline-block;
	float: left;
	position: relative;
	top: -2px;
	width: 89px;
	height: 20px;
	margin-right: 5px;
	padding: 4px 0 0 5px;
	border: 1px solid #EFE0D7;
	background: #FFF9F1;
	z-index: 0;
}
.rating-wrap ul,.rating-wrap a:hover {
	background-image: url(../images/star_shade.png);
	background-repeat: no-repeat;
}
.rating-wrap ul {
	-webkit-padding-start: 40px;
	display: block;
	list-style-type: disc;
	margin: 1em 0px;
	border: 0px;
	margin: 0px;
	outline: 0px;
	padding: 0px;
	list-style: none;
	position: relative;
	width: 85px;
	height: 16px;
	background-position: 0 -90px;
	z-index: 10;
}
.rating-wrap li {
	display: inline;
}
.rating-wrap a {
	zoom: 1;
	position: absolute;
	left: 0;
	top: 0;
	display: block;
	height: 16px;
}
.rating-wrap .five-stars {
	width: 84px;
	z-index: 10;
	background-position: 0 0px;
}
.rating-wrap .four-stars {
	width: 68px;
	z-index: 20;
	background-position: 0 -18px;
}
.rating-wrap .three-stars {
	width: 51px;
	z-index: 30;
	background-position: 0 -36px;
}
.rating-wrap .two-stars {
	width: 34px;
	z-index: 40;
	background-position: 0 -54px;
}
.rating-wrap .one-star {
	width: 17px;
	z-index: 50;
	background-position: 0 -72px;
}
.active-hint{
	color: #C00;
	float: left;
	padding-top:2px;
	font-weight: normal;
	font-style:normal;
}
JS:
$(document).ready(function(){
	$("#appraiseText").bind("keydown", function(){
		var count = $("#appraiseText").val().length;
		if( count <= 200 ){
			$("#textCount").html(" 还能输入<font color='green'><b>" + (200 - count) + "</b></font>个字");
		}else{
			$("#textCount").html(" 已超出<font color='red'><b>" + (count - 200) + "</b></font>个字");
		}
	});	
});
var starValue=0;
function onUlMouseOut(){
	var y = -90 + starValue * 18;
	var position = "0 " + y + "px";
	$(".rating-wrap-ul").css({
		"background-position" : position
	});
}
function onUlMouseOver(){
	$(".rating-wrap-ul").css({
		"background-position" : "0 -90px"
	});
}
function onLiMouseOver(grade){
	switch(grade){
		case 1 : document.getElementById("ratingText").innerHTML="很差";break;
		case 2 : document.getElementById("ratingText").innerHTML="差";break;
		case 3 : document.getElementById("ratingText").innerHTML="还行";break;
		case 4 : document.getElementById("ratingText").innerHTML="好";break;
		case 5 : document.getElementById("ratingText").innerHTML="很好";break;
		default :  document.getElementById("ratingText").innerHTML="";
	}
}
function onLiMouseOut(){
	onLiMouseOver(starValue);
}
function clickStar(grade){
	starValue = grade;		
	var y = -90 + grade * 18;
	var position = "0 " + y + "px";
	$(".rating-wrap-ul").css({
		"background-position" : position
	});
}
希望能帮到你
『伍』 像这种点击就弹出评论框的jquery怎么做说说思路
比如底下那个评论列表的容器层 ,也就是你画的红框的id="pinlun",
两种思路:专
整个页面加载的属时候就把评论也加载完了,但是先隐藏起来,点击时候显示
点击时候实时跟后台ajax交互获取数据,然后innerHtml到pinlin这个层里显示出来。
『陆』 下载好的jQuery留言评论源码放进我自己的html页面然后测试留言一刷新就没了,
首先,你的留言只是在本地上的,没有储存在数据库,数据也不是通过数据库返回的,只是临时存储在浏览器上,所以只要一刷新就没有了。
『柒』 Jquery显示评论有点问题
//试试这样呢?
$.each($('.bottom'),function(index,value){
(function(i){
$(this).on('click','.comment',function(){
//作判断,需登录才能显示出评论框
if($.cookie('userName')){
if($('.comment_list').eq(i).is(':hidden')){
$('.comment_list').eq(i).show();
}else{
$('.comment_list').eq(i).hide();
}
}else{
$('#error').dialog('open');
setTimeout(function(){
$('#login').dialog('open');
$('#error').dialog('close');
},1000);
}
})(index)
});
『捌』 Jquery怎样实现Ctrl+Enter组合键快捷发表评论
jQuery 实现 Ctrl+Enter 快捷键发表评论 jquery代码:
<script language="javascript">
jQuery(document).keypress(function(e){
if(e.ctrlKey && e.which == 13 || e.which == 10) {
jQuery("#commentForm").submit();
} else if (e.shiftKey && e.which==13 || e.which == 10) {
jQuery("#commentform").submit();
}
})
</script>
重点介绍:
在ff中 判断 ctrl+enter 是 e.ctrlKey && e.which ==13
在ie6中 判断ctrl+enter 是 e.ctrlKey && e.which ==10
 其他案例:
<textarea name="comment" id="comment"  tabindex="4" ></textarea>
改成:
<textarea name="comment" id="comment"  tabindex="4" onkeydown="if(event.ctrlKey&&event.keyCode==13){document.getElementById('submit').click();return false};"></textarea>
以上是为大家分享的Ctrl+Enter实现发表的代码,当在文本域内使用组合键Ctrl+Enter怎样实现发布的代码,供大家参考学习。
『玖』 jquery星级评论效果怎么做的
参考网络经验回答 :http://jingyan..com/article/d621e8da31366e2865913f96.html
