diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aed1d9b --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# 忽略 .idea 文件夹 +/.idea/ + diff --git a/.idea/workspace.xml b/.idea/workspace.xml index ba38ca0..4ab511c 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -23,21 +23,11 @@ - - - - - - - - - - - + - - + + @@ -46,27 +36,17 @@ - + - + - - - - - - - - - - - - + + @@ -85,9 +65,11 @@ @@ -188,14 +170,6 @@ - - - - - + @@ -283,6 +265,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -303,7 +326,7 @@ - + @@ -320,30 +343,52 @@ + + + + + + + + + + + + + + + + + + + + + + - - + + - + - - + + - - + + @@ -352,27 +397,11 @@ - + - - - - - - - - - - - - - - - - diff --git a/css/frame.css b/css/frame.css index baa61cb..50d22be 100644 --- a/css/frame.css +++ b/css/frame.css @@ -41,7 +41,7 @@ transition:width .5s , top .5s , left .5s; } -.container iframe { +.container .mypage { width: 100%; height: 100%; } diff --git a/frame.html b/frame.html index e83d432..1ca969a 100644 --- a/frame.html +++ b/frame.html @@ -33,6 +33,7 @@ + diff --git a/home.html b/home.html index b9581f5..397ac81 100644 --- a/home.html +++ b/home.html @@ -6,5 +6,11 @@

首页

+ + \ No newline at end of file diff --git a/js/DIVembed.js b/js/DIVembed.js new file mode 100644 index 0000000..0952c97 --- /dev/null +++ b/js/DIVembed.js @@ -0,0 +1,21 @@ +/** + * Created by 004928 on 2017/7/10. + */ +/** + * 加载Html + * @param containerId 容器id + * @param filePath 文件路径 + * @param cb 加载完成后的回调 文件路径 + */ +function loadPage (containerId , filePath , cb) { + if(typeof window.$ === 'undefined' || window.$ == null) throw "请先引入jq"; + $.ajax({ + url: filePath , + type:'GET', + dataType:'html', + success:function (data) { + $(containerId).html(data); + if(cb) {cb();} + } + }) +} \ No newline at end of file diff --git a/js/frame.js b/js/frame.js index db0ac4b..4c063d2 100644 --- a/js/frame.js +++ b/js/frame.js @@ -266,13 +266,16 @@ * @param path */ function createTabPage (id , path) { - var page = $(""); + //var page = $(""); + var page = $("
"); if(currPage != null) { currPage.addClass('hide'); } $(".container").append(page); page.removeClass('hide'); currPage = page ; + // 加载目标网页 + window.loadPage(page[0] , path); } /** @@ -295,7 +298,7 @@ */ function switchPage (id) { currPage.addClass('hide'); - currPage = $("#iframe"+id).removeClass('hide'); + currPage = $("#page"+id).removeClass('hide'); } /** @@ -305,7 +308,7 @@ */ function closePage (id , tab) { $(tab).closest(".tab").remove(); - $("#iframe"+id).remove(); + $("#page"+id).remove(); } /**