系统通知
layui.use(['element', 'form', 'laydate', 'laypage'], function () {
var element = layui.element,
form = layui.form,
$ = layui.$,
layer = layui.layer,
laydate = layui.laydate,
laypage = layui.laypage
/*渲染 时间选择器*/
laydate.render({elem: '#date1', range: '-'});
/*分页*/
laypage.render({
elem: 'file-pages1',
count: 100,
theme: '#0673ea',
prev: '
next: '>',
layout: ['prev', 'page', 'next', 'skip'],
/*分页跳转*/
jump: function (obj, first) {
var curr = obj.curr;
console.log('跳转当前页curr', curr);
// todo
}
});
/*模拟文件点击选择*/
$('.library-item-box').on('click', function () {
var child = $(this).find('input[type="checkbox"]');
if (child.is(":checked")) {
console.log("选中");
$(this).css('background', 'rgba(3,115,234,.05)');
} else {
console.log("未选中");
$(this).css('background', 'none');
}
})
/*模拟视图切换*/
$('.my-tab-changes .iconfont').on('click', function () {
var type = $(this).attr('type');
$(this).addClass('my-tab-on').siblings().removeClass('my-tab-on');
$('.my-tab-show' + type).show();
$('.my-tab-show' + (1 - type)).hide();
})
})
一键复制
编辑
Web IDE
原始数据
按行查看
历史