标签:ons cti data module class border exists com tab页
//添加 刷新 指定刷新 define(function (require, exports, module) { if (!window.cms) window.cms = {}; cms = { //添加新Tab页 addTab: function (data) { var content = ‘<iframe scrolling="auto" frameborder="0" src="‘ + data.url + ‘" style="width:100%;height:100%;"></iframe>‘; if ($(‘#homePageTabs‘).tabs(‘exists‘, data.title)) { // 选 中当前Tab $(‘#homePageTabs‘).tabs(‘select‘, data.title); // 重新加载已经存在的Tab内容 var currTab = $(‘#homePageTabs‘).tabs(‘getTab‘, data.title); $(‘#homePageTabs‘).tabs(‘update‘, { tab: currTab, options: { content: content, closable: true } }); } else { $(‘#homePageTabs‘).tabs(‘add‘, { title: data.title, content: content, closable: true }); } }, //关闭指定Tab closeTab: function (title) { if ($(‘#homePageTabs‘).tabs(‘exists‘, title)) { $(‘#homePageTabs‘).tabs(‘close‘, title); } }, //刷新指定Tab的内容 refreshTab: function (title) { if ($(‘#homePageTabs‘).tabs(‘exists‘, title)) { var currTab = $(‘#homePageTabs‘).tabs(‘getTab‘, title), iframe = $(currTab.panel(‘options‘).content), content = ‘<iframe scrolling="auto" frameborder="0" src="‘ + iframe.attr(‘src‘) + ‘" style="width:100%;height:100%;"></iframe>‘; $(‘#homePageTabs‘).tabs(‘update‘, { tab: currTab, options: { content: content, closable: true } }); } } } });
转自别人文章,
原地址:http://chengyong.iteye.com/blog/1846455
标签:ons cti data module class border exists com tab页
原文地址:http://www.cnblogs.com/duanyuerui/p/7111207.html