Browse Source

留言回复框自增高度

luyanan 7 years ago
parent
commit
e703f1a7f7
3 changed files with 6 additions and 6 deletions
  1. 3 3
      js/answerLeaveW.js
  2. 2 2
      js/informLeaveW.js
  3. 1 1
      js/leaveWord.js

+ 3 - 3
js/answerLeaveW.js

181
	LeaveWord.prototype.autoGrow=function(){
181
	LeaveWord.prototype.autoGrow=function(){
182
		document.getElementById("tt").style.width=this.scrollWidth+"px";
182
		document.getElementById("tt").style.width=this.scrollWidth+"px";
183
		document.getElementById("tt").value=this.value;
183
		document.getElementById("tt").value=this.value;
184
		this.style.height=document.getElementById("tt").scrollHeight+"px";
184
		this.style.height=this.scrollHeight+"px";
185
	}
185
	}
186
	LeaveWord.prototype.bindEvent = function() {
186
	LeaveWord.prototype.bindEvent = function() {
187
		var self = this;
187
		var self = this;
207
					break;
207
					break;
208
				case "hReply btnModel":self.replyLword(target,obj)
208
				case "hReply btnModel":self.replyLword(target,obj)
209
					break;
209
					break;
210
				case "qCancel": $(target).parent().siblings("textarea").val("").parents(".replyLeword").addClass("displayNone").siblings(".operateSpan").removeClass("displayNone")
210
				case "qCancel": $(target).parent().siblings("textarea").val("").parents(".replyLeword").addClass("displayNone").siblings(".operateSpan").removeClass("displayNone");
211
								$(target).parent().siblings("textarea").css("height",'38px');
211
					break;
212
					break;
212
			}
213
			}
213
		});
214
		});
278
		}, "GET", function(data) {
279
		}, "GET", function(data) {
279
			self.LwordTotal($($this).parents(".commentList"),{sid:lid.refId,stype:lid.refType});
280
			self.LwordTotal($($this).parents(".commentList"),{sid:lid.refId,stype:lid.refType});
280
			$($this).parents(".li-item").remove();
281
			$($this).parents(".li-item").remove();
281
			
282
		})
282
		})
283
		
283
		
284
	}
284
	}

+ 2 - 2
js/informLeaveW.js

108
	LeaveWord.prototype.autoGrow = function() {
108
	LeaveWord.prototype.autoGrow = function() {
109
		document.getElementById("tt").style.width = this.scrollWidth + "px";
109
		document.getElementById("tt").style.width = this.scrollWidth + "px";
110
		document.getElementById("tt").value = this.value;
110
		document.getElementById("tt").value = this.value;
111
		this.style.height = document.getElementById("tt").scrollHeight + "px";
111
		this.style.height = this.scrollHeight + "px";
112
	}
112
	}
113
	LeaveWord.prototype.bindEvent = function() {
113
	LeaveWord.prototype.bindEvent = function() {
114
		var self = this;
114
		var self = this;
127
					break;
127
					break;
128
				case "hReply btnModel":self.replyLword(target,obj.id)
128
				case "hReply btnModel":self.replyLword(target,obj.id)
129
					break;
129
					break;
130
				case "qCancel": $(target).parent().siblings("textarea").val("").parents(".replyLeword").addClass("displayNone").siblings(".operateSpan").removeClass("displayNone")
130
				case "qCancel": $(target).parent().siblings("textarea").val("").parents(".replyLeword").addClass("displayNone").siblings(".operateSpan").removeClass("displayNone");$(target).parent().siblings("textarea").style.height='38px';
131
					break;
131
					break;
132
			}
132
			}
133
		});
133
		});

+ 1 - 1
js/leaveWord.js

148
	LeaveWord.prototype.autoGrow=function(){
148
	LeaveWord.prototype.autoGrow=function(){
149
		document.getElementById("tt").style.width=this.scrollWidth+"px";
149
		document.getElementById("tt").style.width=this.scrollWidth+"px";
150
		document.getElementById("tt").value=this.value;
150
		document.getElementById("tt").value=this.value;
151
		this.style.height=document.getElementById("tt").scrollHeight+"px";
151
		this.style.height=this.scrollHeight+"px";
152
	}
152
	}
153
	LeaveWord.prototype.bindEvent = function() {
153
	LeaveWord.prototype.bindEvent = function() {
154
		var self = this;
154
		var self = this;