首页 > 其他 > 详细

3、主页添加script代码

时间:2018-01-28 15:17:29      阅读:240      评论:0      收藏:0      [点我收藏+]

为Home控制器下的Index添加Scrip代码,手动敲入script,按Tab键,页面自动补齐<script></script> 

技术分享图片
 1 <script>
 2 
 3     //增加选项卡
 4     function addTab(subtitle, url) {
 5         if (!$("#mainTab").tabs(exists, subtitle)) {  //若选项卡不存在,生成新的选项卡
 6             var con = <iframe frameborder="0" scrolling="auto" style="width:99.5%; height:99%"  src=" + url + "></iframe>;
 7             $("#mainTab").tabs(add, {
 8                 title: subtitle,
 9                 content: con,
10                 closable: true,
11                 loadingMessage: 加载中......
12             });
13         } else {     //若选项卡已存在,选择该选项卡
14             $("#mainTab").tabs(select, subtitle);
15             $("#tab_menu-tabrefresh").trigger("click");
16         }
17     }
18 
19     //刷新选项卡
20     function refreshTab() {
21         var index = $(#mainTab).tabs(getTabIndex, $(#mainTab).tabs(getSelected));
22         if (index != -1) {
23             var tab = $(#mainTab).tabs(getTab, index);
24             $(#mainTab).tabs(update, {
25                 tab: tab,
26                 options: {
27                     selected: true
28                 }
29             });
30         }
31     }
32 
33     //关闭选项卡
34     function closeTab() {
35         $(.tabs-inner span).each(function (i, n) {
36             var t = $(n).text();
37             if (t != ‘‘) {
38                 if (t != "我的主页") {
39                     $(#mainTab).tabs(close, t);
40                 }
41             }
42         });
43     }
44 
45 </script>
Tab选项卡

 

3、主页添加script代码

原文:https://www.cnblogs.com/shiliumu/p/8371156.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!