完善二级菜单
parent
92c03257c2
commit
dac9be277f
|
|
@ -90,5 +90,10 @@ okToolbar span{float:right;line-height:30px}
|
||||||
.tac{text-align:center;}
|
.tac{text-align:center;}
|
||||||
.tar{text-align:right;}
|
.tar{text-align:right;}
|
||||||
|
|
||||||
|
/*三级菜单、四级菜单、五级菜单、六级菜单*/
|
||||||
|
.layui-nav-tree .layui-nav-item .layui-nav-child .layui-nav-child a{padding-left: 54px;}
|
||||||
|
.layui-nav-tree .layui-nav-item .layui-nav-child .layui-nav-child .layui-nav-child a{padding-left: 74px;}
|
||||||
|
.layui-nav-tree .layui-nav-item .layui-nav-child .layui-nav-child .layui-nav-child .layui-nav-child a{padding-left: 94px;}
|
||||||
|
.layui-nav-tree .layui-nav-item .layui-nav-child .layui-nav-child .layui-nav-child .layui-nav-child .layui-nav-child a{padding-left: 114px;}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -93,10 +93,10 @@ layui.config({
|
||||||
var html = "";
|
var html = "";
|
||||||
if (obj != undefined && obj.length > 0) {
|
if (obj != undefined && obj.length > 0) {
|
||||||
html += "<dl class='layui-nav-child'>"
|
html += "<dl class='layui-nav-child'>"
|
||||||
for (var j = 0; j < obj.length; j++) {
|
for (var i = 0; i < obj.length; i++) {
|
||||||
html += "<dd>";
|
html += "<dd>";
|
||||||
html += "<a href='javascript:;' path='" + obj[j].path + "'>" + iconHtml(obj[j]) + " " + obj[j].title + "</a>";
|
html += "<a href='javascript:;' path='" + obj[i].path + "'>" + iconHtml(obj[i]) + " " + obj[i].title + "</a>";
|
||||||
var children = obj[j].children;
|
var children = obj[i].children;
|
||||||
if (children != undefined && children.length > 0) {
|
if (children != undefined && children.length > 0) {
|
||||||
html += createMenu(children);
|
html += createMenu(children);
|
||||||
}
|
}
|
||||||
|
|
@ -107,21 +107,11 @@ layui.config({
|
||||||
return html;
|
return html;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO
|
|
||||||
function createSpace(num) {
|
|
||||||
var html = "";
|
|
||||||
for (var i = 0; i < num; i++) {
|
|
||||||
html += " ";
|
|
||||||
}
|
|
||||||
return html;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 监听导航菜单的点击
|
* 监听导航菜单的点击
|
||||||
*/
|
*/
|
||||||
element.on("nav(navFilter)", function (elem) {
|
element.on("nav(navFilter)", function (elem) {
|
||||||
var path = elem.context.attributes.path;
|
var path = elem.context.attributes.path;
|
||||||
console.log(path);
|
|
||||||
if (path && path.textContent != "") {
|
if (path && path.textContent != "") {
|
||||||
// var title = elem.context.innerHTML;
|
// var title = elem.context.innerHTML;
|
||||||
var title = elem.context.innerText;
|
var title = elem.context.innerText;
|
||||||
|
|
|
||||||
|
|
@ -52,11 +52,11 @@ okTab.tabAdd("ok-tool", "http://www.xlbweb.cn")
|
||||||
layui.code({about: false});
|
layui.code({about: false});
|
||||||
|
|
||||||
$("#addTab1").click(function () {
|
$("#addTab1").click(function () {
|
||||||
okTab.add("okLayerSub", "pages/use/use-okLayer.html");
|
okTab.add("瓜子二手车", "https://www.guazi.com");
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#addTab2").click(function () {
|
$("#addTab2").click(function () {
|
||||||
okTab.add("ok-toolSub", "http://tool.xlbweb.cn");
|
okTab.add("国美电器", "https://www.gome.com.cn");
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue