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
