前台代码:

<div data-options="region:'west',title:'我的工作平台',split:true,iconCls:'icon-desk'"  style="width: 200px;">
        <div ></div>
        </div>
    </div>

js代码:

$(function () {
    $(".easyui-tree").tree({
        onClick: function (node) {
            AddTab(node.text, node.id);
        }
    });

    function AddTab(title, url) {

       //判断选项卡是否重复打开
        if ($('#tabs').tabs('exists', title)) {
            $('#tabs').tabs('select', title);//选中并刷新
        } else {
            var content = createFrame(url); //创建Frame
            $("#tabs").tabs("add", {
                title: title,
                content: content,
                closable: true

            })
        }
       
    }
    //创建Frame
    function createFrame(url) {
        var tabHeight = $("#tabs").height() - 35;
        var s = '<iframe scrolling="auto" frameborder="0"  src="' + url + '" style="width:100%;height:' + tabHeight + 'px;"></iframe>';
        return s;
    }

});
 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-10
  • 2021-07-18
  • 2021-10-10
  • 2022-02-12
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-09-12
  • 2022-12-23
  • 2022-01-21
  • 2021-07-20
相关资源
相似解决方案