demo前端模版添加

This commit is contained in:
zhh
2018-04-17 09:03:32 +08:00
parent 109a95d3de
commit 5dca3a75df
211 changed files with 47407 additions and 104 deletions

View File

@@ -0,0 +1,40 @@
$(function() {
// Waves初始化
Waves.displayEffect();
// 数据表格动态高度
$(window).resize(function () {
$('#table').bootstrapTable('resetView', {
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');
}
});
// select2初始化
$('select').select2();
});
// 动态高度
function getHeight() {
return $(window).height() - 20;
}
// 数据表格展开内容
function detailFormatter(index, row) {
var html = [];
$.each(row, function (key, value) {
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');
}
});
}