优化系统左侧菜单跟随效果,tab切换,菜单跟随。
This commit is contained in:
parent
932dfd0e77
commit
0a794b60bc
@ -118,6 +118,20 @@ layui.define(['element'], function (exports) {
|
|||||||
if ($itemleft + $item.outerWidth() >= $outerWidth - $left) return $tabTitle.css("left", -$itemleft), false;
|
if ($itemleft + $item.outerWidth() >= $outerWidth - $left) return $tabTitle.css("left", -$itemleft), false;
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
tabFollow:function(id){
|
||||||
|
$('.layui-nav-tree').find('.side-menu-item').removeClass('layui-this');
|
||||||
|
$('.layui-nav-tree').find('dd').removeClass('layui-this');
|
||||||
|
$('.layui-nav-tree').find('dd').removeClass('layui-nav-itemed');
|
||||||
|
$('.layui-nav-tree').find('.menu-li').removeClass('layui-nav-itemed');
|
||||||
|
$('.side-menu-item').each(function (index,item){
|
||||||
|
if($(item).data("id") == id) {
|
||||||
|
//console.log(item);
|
||||||
|
$(item).addClass('layui-this');
|
||||||
|
$(item).parents('dd').addClass('layui-nav-itemed');
|
||||||
|
$(item).parents('.menu-li').addClass('layui-nav-itemed');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
refresh:function(id){
|
refresh:function(id){
|
||||||
if(parent.document.getElementById(id)){
|
if(parent.document.getElementById(id)){
|
||||||
var src = parent.document.getElementById(id).contentWindow.location.href ? parent.document.getElementById(id).contentWindow.location.href : iframe.src;
|
var src = parent.document.getElementById(id).contentWindow.location.href ? parent.document.getElementById(id).contentWindow.location.href : iframe.src;
|
||||||
@ -173,11 +187,12 @@ layui.define(['element'], function (exports) {
|
|||||||
//切换tab
|
//切换tab
|
||||||
element.on('tab(gg-admin-tab)', function (data) {
|
element.on('tab(gg-admin-tab)', function (data) {
|
||||||
let thisPage = $('#GouguAppBody').find('.gg-tab-page').eq(data.index);
|
let thisPage = $('#GouguAppBody').find('.gg-tab-page').eq(data.index);
|
||||||
|
let id = thisPage.data('id');
|
||||||
|
let url = thisPage.data('url');
|
||||||
if(thisPage.find('iframe').length==0){
|
if(thisPage.find('iframe').length==0){
|
||||||
let id = thisPage.data('id');
|
|
||||||
let url = thisPage.data('url');
|
|
||||||
thisPage.html('<iframe id="' + id + '" data-frameid="' + id + '" src="' + url + '" frameborder="0" align="left" width="100%" height="100%" scrolling="yes"></iframe>');
|
thisPage.html('<iframe id="' + id + '" data-frameid="' + id + '" src="' + url + '" frameborder="0" align="left" width="100%" height="100%" scrolling="yes"></iframe>');
|
||||||
}
|
}
|
||||||
|
tab.tabFollow(id);
|
||||||
$('#GouguAppBody').find('.gg-tab-page').removeClass('layui-show');
|
$('#GouguAppBody').find('.gg-tab-page').removeClass('layui-show');
|
||||||
thisPage.addClass('layui-show');
|
thisPage.addClass('layui-show');
|
||||||
if(data.index==0){
|
if(data.index==0){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user