|
表格hover效果: 在头部样式 [HTML] syntaxhighlighter_viewsource syntaxhighlighter_copycode .layui-table-hover {
background-color: deepskyblue !important;
}
.myTableCrossColor {
background-color: #D1EEEE;
}
表格加载后 [HTML] syntaxhighlighter_viewsource syntaxhighlighter_copycode done: function (res, curr, count) {
var that = this.elem.next();
if (res.data.length == 0) {
return;
}
res.data.forEach(function (item, index) {
if (index % 3 == 0) {
var tr = that.find(".layui-table-box tbody tr[data-index='" + index + "']").addClass("myTableCrossColor");
} else {
//var tr = that.find(".layui-table-box tbody tr[data-index='" + index + "']").css("background-color", 'white');
}
})
} |
|
layuiadmin左侧增加四级菜单 (导航默认是三级) https://download.csdn.net/download/sinat_26708145/10825149 |
|
form表单内,select下拉的选中方法 先加selected的属性,然后再form.render刷新一下 $("select[name=state]").find("option[value='" + state + "']").attr("selected", true); form.render(); //layui.form().render(); //这是1.0的写法 //layui.form.render(); //这是2.0更新后的写法 |
|
本帖最后由 李维强-15级 于 2019-4-14 20:17 编辑 LAYUI上传显示进度条示例 https://blog.csdn.net/qq_36311372/article/details/82117417 https://www.cnblogs.com/youmingkuang/p/9183528.html |
本帖最后由 李维强-15级 于 2019-4-13 17:50 编辑
layui2.4.zip
(1.73 MB, 下载次数: 3)
页面底部的设置尤为关键 <script src="layui/layui.js"></script> <script> layui.config({ base: '../' //静态资源所在路径 也就是当前文件夹之前的父级目录 }).extend({ index: 'layui2.4/lib/index' //主入口模块 }).use('index'); </script> 实际上的目录为两者相加../layui2.4/lib/index 这样~~~~ 也可以这样组合 layui.config({ base: './' //静态资源所在路径 也就是当前文件夹目录 }).extend({ index: 'lib/index' //主入口模块 }).use('index'); 这样也可以 ,./表示当前目录下,然后组合起来就是./lib/index 和之前一样
layuiAdmin.std-v1.1.0.zip
(3.6 MB, 下载次数: 0)
layuiAdmin std v1.x 【iframe版】.pdf
(786.26 KB, 下载次数: 4)
|
|
fa图标使用 先引 <link rel="stylesheet" href="~/Content/layui/plugins/font-awesome/css/font-awesome.min.css" media="all"> 然后直接CSS用 图标具体在这里 http://www.fontawesome.com.cn |
|
添加类似easyui里面的from.load方法 在jquery文件里面 最后加入 [JavaScript] syntaxhighlighter_viewsource syntaxhighlighter_copycode $.fn.loadForm = function (data) {
if (Object.prototype.toString.call(data) === '[object String]') {
data = eval('(' + data + ')');
}
var form = $(this);
for (var name in data) {
var value = data[name];
var cc = form.find('input[name="' + name + '"][type=radio], input[name="' + name + '"][type=checkbox]');
if (cc.length) {
cc.each(function () {
if (isChecked($(this).val(), value)) {
$(this).attr('checked', true);
}
});
} else {
form.find('input[name="' + name + '"]').val(value);
form.find('textarea[name="' + name + '"]').val(value);
form.find('select[name="' + name + '"]').val(value);
}
}
function isChecked(val, value) {
if (val == String(value) || $.inArray(val, $.isArray(value) ? value : [value]) >= 0) {
return true;
} else {
return false;
}
}
} |
Archiver|手机版|小黑屋|cqutlab
( 渝ICP备15004556号 ) 
GMT+8, 2025-11-4 02:14 , Processed in 0.138069 second(s), 34 queries .
Powered by Discuz! X3.1
© 2001-2013 Comsenz Inc.