From 9676f6c88b39254939ab440360b0660f83ea6d1c Mon Sep 17 00:00:00 2001 From: Sergio Date: Tue, 26 Sep 2017 13:35:51 +0200 Subject: [PATCH] bug carga mapa --- .DS_Store | Bin 6148 -> 6148 bytes index.html | 18 +++++++++++++++ js/main.js | 51 +++++++++++++++---------------------------- templates/page2.html | 2 +- templates/page3.html | 16 +++++++------- templates/page4.html | 2 +- templates/page5.html | 29 ++++++++++++++++++++++++ templates/page6.html | 29 ++++++++++++++++++++++++ templates/page7.html | 29 ++++++++++++++++++++++++ 9 files changed, 133 insertions(+), 43 deletions(-) create mode 100644 templates/page5.html create mode 100644 templates/page6.html create mode 100644 templates/page7.html diff --git a/.DS_Store b/.DS_Store index 0bcf19251bb336e812264ecf535ccd644ba18a9c..6a67ee0971c173e76d49be11b07361095b89c953 100644 GIT binary patch delta 217 zcmZoMXfc=|#>B!ku~2NHo+2ab#(>?7iyN4k7+E*-FvT;PaWa%Jq%!0(6fop4B!bz+ zN#(@_NjdpR3=9k>k_vJ%i%Sd)t}`+*v#_$Ub8v8QbMSIZE@TpB3(ibQO-h`+lF5lP zAh9GPDY1x?bMjv%c?WS-LtD>;+{&uzn%cSB)qu~2NHo+2aj#(>?7jLe&PSmGHsm$OY^+}OawyqTSYp9837vmnQJ W=E?jbjvNd?z{tSBvN=Lz4Kn~t-w%5L diff --git a/index.html b/index.html index 252c5f2..41855f2 100644 --- a/index.html +++ b/index.html @@ -60,6 +60,21 @@
+
+
+
+
+ +
+
+
+
+ +
+
+
+
+
@@ -71,6 +86,9 @@ + + + diff --git a/js/main.js b/js/main.js index cc56396..dc1c4b2 100644 --- a/js/main.js +++ b/js/main.js @@ -1,16 +1,14 @@ viewStatus= "story" /* data story */ -pages= 0 -totalPages=3; +pagesLoaded= 0 +totalPages=7; window.onload = function() { - console.log("on load") width = 1000, height = 1000; loadPageTemplates() - $('#pagepiling').pagepiling({ menu: null, - anchors: ["page1","page2","page3","page4"], + anchors: ["page1","page2","page3","page4","page5","page6","page7"], direction: 'horizontal', verticalCentered: true, scrollingSpeed: 800, @@ -26,50 +24,37 @@ window.onload = function() { } function loadPageTemplates(){ - console.log("load templates") - $('#page-1').load("templates/page1.html",function(){ - loadModalEvent(1); - counterLoading(); - }) - - $('#page-2').load("templates/page2.html",function(){ - loadModalEvent(2); - counterLoading(); - }) - - $('#page-3').load("templates/page3.html",function(){ - loadModalEvent(3); - counterLoading(); - }) - $('#page-4').load("templates/page4.html",function(){ - loadModalEvent(4); - counterLoading(); - }) - turnEventsOn(); + for (var i=1; i<= totalPages; i++){ + (function (n) { + $('#page-'+n).load("templates/page"+n+".html",function(){ + counterLoading(); + loadModalEvent(n); + }) + })(i) + } + //turnEventsOn(); } -function loadModalEvent( i){ +function loadModalEvent(j){ var modal = new jBox('Modal', { - attach: '#map-btn-page-'+i, - content: $('#map-page-'+i), + attach: '#map-btn-page-'+j, + content: $('#map-page-'+j), closeButton: 'box' }); } function counterLoading(){ - pages++; - - if(pages>totalPages){ + pagesLoaded++; + if(pagesLoaded >= totalPages){ + //Todas las plantillas cargadas $('.menu-content').on("click",'.switchMode', function(e){ - console.log("menu content") if(viewStatus=="story") viewStatus="data" else{ viewStatus="story" } - if(viewStatus=="story"){ $('.story-content').show(); $('.data-content').hide(); diff --git a/templates/page2.html b/templates/page2.html index 7852ffb..f7bbddb 100644 --- a/templates/page2.html +++ b/templates/page2.html @@ -19,7 +19,7 @@ diff --git a/templates/page3.html b/templates/page3.html index 346fbce..1b2e64c 100644 --- a/templates/page3.html +++ b/templates/page3.html @@ -1,12 +1,13 @@ diff --git a/templates/page4.html b/templates/page4.html index 622c0d8..847b026 100644 --- a/templates/page4.html +++ b/templates/page4.html @@ -19,7 +19,7 @@ diff --git a/templates/page5.html b/templates/page5.html new file mode 100644 index 0000000..74898b8 --- /dev/null +++ b/templates/page5.html @@ -0,0 +1,29 @@ + + +
+ +
diff --git a/templates/page6.html b/templates/page6.html new file mode 100644 index 0000000..6f1c2d1 --- /dev/null +++ b/templates/page6.html @@ -0,0 +1,29 @@ +
+ +
+ +
diff --git a/templates/page7.html b/templates/page7.html new file mode 100644 index 0000000..b681f8b --- /dev/null +++ b/templates/page7.html @@ -0,0 +1,29 @@ +
+ +
+ +