更新common.js

This commit is contained in:
shuzheng 2017-02-24 23:20:34 +08:00
parent 393a906708
commit 371ec172d1
1 changed files with 16 additions and 0 deletions

View File

@ -7,6 +7,14 @@ $(function() {
height: getHeight()
});
});
// 设置input特效
$(document).on('focus', 'input[type="text"]', function() {
$(this).parent().find('label').addClass('active');
}).on('blur', 'input[type="text"]', function() {
if ($(this).val() == '') {
$(this).parent().find('label').removeClass('active');
}
});
});
// 动态高度
function getHeight() {
@ -20,3 +28,11 @@ function detailFormatter(index, row) {
});
return html.join('');
}
// 初始化input特效
function initMaterialInput() {
$('form input[type="text"]').each(function () {
if ($(this).val() != '') {
$(this).parent().find('label').addClass('active');
}
});
}