标签:text java indexof lower ret pre 高度 tor max
var agt = navigator.userAgent.toLowerCase();
var is_op = (agt.indexOf("opera") != -1);
var is_ie = (agt.indexOf("msie") != -1) && document.all && !is_op;
function ResizeTextarea(a, row) {
if (!a) {
return
}
if (!row)
row = 5;
var b = a.value.split("\n");
var c = is_ie ? 1 : 0;
c += b.length;
var d = a.cols;
if (d <= 20) {
d = 40
}
for (var e = 0; e < b.length; e++) {
if (b[e].length >= d) {
c += Math.ceil(b[e].length / d)
}
}
c = Math.max(c, row);
if (c != a.rows) {
a.rows = c;
}
}
标签:text java indexof lower ret pre 高度 tor max
原文地址:https://www.cnblogs.com/thatme/p/10208258.html