更新common.js
This commit is contained in:
parent
393a906708
commit
371ec172d1
|
@ -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() {
|
||||
|
@ -19,4 +27,12 @@ function detailFormatter(index, row) {
|
|||
html.push('<p><b>' + key + ':</b> ' + value + '</p>');
|
||||
});
|
||||
return html.join('');
|
||||
}
|
||||
// 初始化input特效
|
||||
function initMaterialInput() {
|
||||
$('form input[type="text"]').each(function () {
|
||||
if ($(this).val() != '') {
|
||||
$(this).parent().find('label').addClass('active');
|
||||
}
|
||||
});
|
||||
}
|
Loading…
Reference in New Issue