diff --git a/component/pear/module/tab.js b/component/pear/module/tab.js index a398fef..c5c02e2 100644 --- a/component/pear/module/tab.js +++ b/component/pear/module/tab.js @@ -74,7 +74,6 @@ layui.define(['jquery', 'element'], function(exports) { autoLeft += $(this).outerWidth(); } }); - $tabTitle.animate({ scrollLeft: autoLeft - $tabTitle.width() / 3 }, 200); @@ -125,24 +124,16 @@ layui.define(['jquery', 'element'], function(exports) { '' + '' + '' - $("#" + elem).find(".pear-tab").append(load); - var pearLoad = $("#" + elem).find("#pear-tab-loading" + index); - pearLoad.css({ display: "block" }); - setTimeout(function() { - pearLoad.fadeOut(500); - }, time); - index++; } - element.tabAdd(elem, { title: title, content: '', id: opt.id }); - - } } element.tabChange(elem, opt.id); @@ -230,32 +206,22 @@ layui.define(['jquery', 'element'], function(exports) { '' $("#" + this.option.elem).find(".pear-tab").append(load); - var pearLoad = $("#" + this.option.elem).find("#pear-tab-loading" + index); - pearLoad.css({ display: "block" }); setTimeout(function() { - pearLoad.fadeOut(500); - }, time); - index++; } - - element.tabAdd(this.option.elem, { title: title, content: '', id: opt.id }); - - - } else { var isData = false; @@ -270,7 +236,6 @@ layui.define(['jquery', 'element'], function(exports) { return false; } - $.each($(".layui-tab[lay-filter='" + this.option.elem + "'] .layui-tab-title li[lay-id]"), function() { if ($(this).attr("lay-id") == opt.id) { @@ -289,19 +254,14 @@ layui.define(['jquery', 'element'], function(exports) { '' $("#" + this.option.elem).find(".pear-tab").append(load); - var pearLoad = $("#" + this.option.elem).find("#pear-tab-loading" + index); - pearLoad.css({ display: "block" }); setTimeout(function() { - pearLoad.fadeOut(500); - }, time); - index++; } @@ -311,8 +271,6 @@ layui.define(['jquery', 'element'], function(exports) { opt.url + '" style="width:100%;height:100%;">', id: opt.id }); - - } } element.tabChange(this.option.elem, opt.id); @@ -332,28 +290,20 @@ layui.define(['jquery', 'element'], function(exports) { '' var elem = this.option.elem; - $("#" + this.option.elem).find(".pear-tab").append(load); - var pearLoad = $("#" + this.option.elem).find("#pear-tab-loading" + index); - pearLoad.css({ display: "block" }); - index++; - setTimeout(function() { pearLoad.fadeOut(500,function(){ pearLoad.remove(); }); }, time); - $(".layui-tab[lay-filter='" + elem + "'] .layui-tab-content .layui-show").find("iframe")[0].contentWindow .location.reload(true); - } else { - $(".layui-tab[lay-filter='" + this.option.elem + "'] .layui-tab-content .layui-show").find("iframe")[0].contentWindow .location.reload(true); }