优化Tab页签切换,会滚动到页面顶部问题(I841ER)

pull/324/MERGE
RuoYi 2023-09-26 09:15:41 +08:00
parent f05195d373
commit 64e6ae4fe4
3 changed files with 12 additions and 12 deletions

View File

@ -157,7 +157,7 @@ $(function() {
// 显示tab对应的内容区
$('.RuoYi_iframe').each(function() {
if ($(this).data('id') == currentId) {
$(this).show().siblings('.RuoYi_iframe').hide();
$(this).css({"visibility": "visible", "position": "static"}).siblings('.RuoYi_iframe').css({"visibility": "hidden", "position": "absolute"});
}
});
$(element).addClass('active').siblings('.menuTab').removeClass('active');
@ -289,7 +289,7 @@ $(function() {
// 显示tab对应的内容区
$('.mainContent .RuoYi_iframe').each(function() {
if ($(this).data('id') == dataUrl) {
$(this).show().siblings('.RuoYi_iframe').hide();
$(this).css({"visibility": "visible", "position": "static"}).siblings('.RuoYi_iframe').css({"visibility": "hidden", "position": "absolute"});
return false;
}
});
@ -308,7 +308,7 @@ $(function() {
// 添加选项卡对应的iframe
var str1 = '<iframe class="RuoYi_iframe" name="iframe' + dataIndex + '" width="100%" height="100%" src="' + dataUrl + '" frameborder="0" data-id="' + dataUrl + '" data-refresh="' + isRefresh + '" seamless></iframe>';
$('.mainContent').find('iframe.RuoYi_iframe').hide().parents('.mainContent').append(str1);
$('.mainContent').find('iframe.RuoYi_iframe').css({"visibility": "hidden", "position": "absolute"}).parents('.mainContent').append(str1);
$.modal.loading("数据加载中,请稍候...");
@ -351,7 +351,7 @@ $(function() {
$('.mainContent .RuoYi_iframe').each(function() {
if ($(this).data('id') == activeId) {
$(this).show().siblings('.RuoYi_iframe').hide();
$(this).css({"visibility": "visible", "position": "static"}).siblings('.RuoYi_iframe').css({"visibility": "hidden", "position": "absolute"});
return false;
}
});
@ -379,7 +379,7 @@ $(function() {
$(this).parents('.menuTab').prev('.menuTab:last').addClass('active');
$('.mainContent .RuoYi_iframe').each(function() {
if ($(this).data('id') == activeId) {
$(this).show().siblings('.RuoYi_iframe').hide();
$(this).css({"visibility": "visible", "position": "static"}).siblings('.RuoYi_iframe').css({"visibility": "hidden", "position": "absolute"});
return false;
}
});
@ -399,7 +399,7 @@ $(function() {
$('.menuTab[data-id="' + panelUrl + '"]').addClass('active').siblings('.menuTab').removeClass('active');
$('.mainContent .RuoYi_iframe').each(function() {
if ($(this).data('id') == panelUrl) {
$(this).show().siblings('.RuoYi_iframe').hide();
$(this).css({"visibility": "visible", "position": "static"}).siblings('.RuoYi_iframe').css({"visibility": "hidden", "position": "absolute"});
return false;
}
});
@ -441,7 +441,7 @@ $(function() {
// 显示tab对应的内容区
$('.mainContent .RuoYi_iframe').each(function() {
if ($(this).data('id') == currentId) {
$(this).show().siblings('.RuoYi_iframe').hide();
$(this).css({"visibility": "visible", "position": "static"}).siblings('.RuoYi_iframe').css({"visibility": "hidden", "position": "absolute"});
isRefresh = $.common.nullToDefault($(this).data('refresh'), false);
return false;
}
@ -493,7 +493,7 @@ $(function() {
$(this).remove();
});
$('.page-tabs-content').children("[data-id]:first").each(function() {
$('.RuoYi_iframe[data-id="' + $(this).data('id') + '"]').show();
$('.RuoYi_iframe[data-id="' + $(this).data('id') + '"]').css({"visibility": "visible", "position": "static"});
$(this).addClass("active");
});
$('.page-tabs-content').css("margin-left", "0");

View File

@ -245,7 +245,7 @@ var closeItem = function(dataId){
$('.menuTab[data-id="' + panelUrl + '"]', topWindow).addClass('active').siblings('.menuTab').removeClass('active');
$('.mainContent .RuoYi_iframe', topWindow).each(function() {
if ($(this).data('id') == panelUrl) {
$(this).show().siblings('.RuoYi_iframe').hide();
$(this).css({"visibility": "visible", "position": "static"}).siblings('.RuoYi_iframe').css({"visibility": "hidden", "position": "absolute"});
return false;
}
});
@ -269,7 +269,7 @@ function createMenuItem(dataUrl, menuName, isRefresh) {
// 显示tab对应的内容区
$('.mainContent .RuoYi_iframe', topWindow).each(function() {
if ($(this).data('id') == dataUrl) {
$(this).show().siblings('.RuoYi_iframe').hide();
$(this).css({"visibility": "visible", "position": "static"}).siblings('.RuoYi_iframe').css({"visibility": "hidden", "position": "absolute"});
return false;
}
});
@ -288,7 +288,7 @@ function createMenuItem(dataUrl, menuName, isRefresh) {
// 添加选项卡对应的iframe
var str1 = '<iframe class="RuoYi_iframe" name="iframe' + dataIndex + '" width="100%" height="100%" src="' + dataUrl + '" frameborder="0" data-id="' + dataUrl + '" data-panel="' + panelUrl + '" seamless></iframe>';
$('.mainContent', topWindow).find('iframe.RuoYi_iframe').hide().parents('.mainContent').append(str1);
$('.mainContent', topWindow).find('iframe.RuoYi_iframe').css({"visibility": "hidden", "position": "absolute"}).parents('.mainContent').append(str1);
window.parent.$.modal.loading("数据加载中,请稍候...");
$('.mainContent iframe:visible', topWindow).on('load', function() {

View File

@ -100,7 +100,7 @@
if ($(this).width() < 769) {
panehHidden = true;
}
$('body').layout({ initClosed: panehHidden, west__size: 185 });
$('body').layout({ initClosed: panehHidden, west__size: 185, resizeWithWindow: false });
// 回到顶部绑定
if ($.fn.toTop !== undefined) {
var opt = {