Commit 8816649c by doszhang

dos

parent 8cbc6e0d
......@@ -105,6 +105,9 @@ $(document).ready(function () {
return;
}
}
if (text.gblen > 10) {
showTip('名字最长为5个汉字');
}
if (text.length === 2) {
var last = text[1];
text = text[0] + ' ' + last;
......@@ -166,7 +169,7 @@ $(document).ready(function () {
$('.page:visible').find('.showBox').show().html('<img src="' + canvas2.toDataURL('image/png') + '">');
});
});
$('input[type=text]').on('input', onInput);
// $('input[type=text]').on('input', onInput);
$('.L-arrow').on('click', function () {
if (firstSwiper) {
firstSwiper.slideNext();
......@@ -349,6 +352,18 @@ var limitMaxLength = function (str, maxLength) {
return result.join('');
}
String.prototype.gblen = function () {
var len = 0;
for (var i = 0; i < this.length; i++) {
if (this.charCodeAt(i) > 127 || this.charCodeAt(i) == 94) {
len += 2;
} else {
len++;
}
}
return len;
}
var mc = new Hammer($('.imgTip').get(0));
mc.get('pan').set({
direction: Hammer.DIRECTION_ALL
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment